Comments (2)
Hi Parth,
I hope you're doing great!
Sorry for my late reply; got busy with university for a while and missed your issue.
Have you tried the infer.py file in the repo? I show there how to run the model for a single image.
from deep-learning.
Hi Moein,
It looks like there is some difference in keys in the saved model and model architecture. While using the infer file, I am getting the following error. Any thoughts on how to fix this?
model initialized with norm initialization
model initialized with norm initialization
RuntimeError Traceback (most recent call last)
in <cell line: 11>()
9 saved_model_dict = torch.load('final_model_weights.pt', map_location=device)
10 model = MainModel()
---> 11 model.load_state_dict(saved_model_dict)
12
13 # Load the black and white image and resize it
/usr/local/lib/python3.9/dist-packages/torch/nn/modules/module.py in load_state_dict(self, state_dict, strict)
2039
2040 if len(error_msgs) > 0:
-> 2041 raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
2042 self.class.name, "\n\t".join(error_msgs)))
2043 return _IncompatibleKeys(missing_keys, unexpected_keys)
RuntimeError: Error(s) in loading state_dict for MainModel:
Missing key(s) in state_dict: "net_G.model.model.0.weight",
from deep-learning.
Related Issues (9)
- How to prediction on single image HOT 7
- Issue with running infer file
- AttributeError: 'function' object has no attribute 'named_parameters' HOT 3
- can't create the body of ResNet18 HOT 3
- The code takes 4h foe each epoch in google colab. HOT 3
- Error on pretrain_generator HOT 3
- Code for using the trained model... HOT 7
- PyTorch Lightning implementation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deep-learning.