-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update for PyTorch 0.4.0 #21
Comments
set |
I went the other way with the following: # /~https://github.com/zhanghang1989/PyTorch-Multi-Style-Transfer/issues/21
# Compatibility shim for PyTorch 0.4
model_dict = torch.load('21styles.model')
model_dict_clone = model_dict.copy() # We can't mutate while iterating
for key, value in model_dict_clone.items():
if key.endswith(('running_mean', 'running_var')):
del model_dict[key]
### Next cell
style_model = Net(ngf=128)
style_model.load_state_dict(model_dict, False) |
to
|
Just got For a while I was getting this error:
The quick way to debug is was by replacing my command-line My full fixes were: 1. Downgrade torch:
2. In camera_demo.py and main.py replace
With
Replace
With
3. Replace
With
QUESTION (Note that the documentation shows that track_running_stats=True is the default for most normalization layer classes.) I've gotten main.py working with torch upgraded, but camera_demo gives an all-black image as output. I'm interested in comments, or ideas! |
@karenerobinson I think the most reasonable way would be to wait for PyTorch 1.0 that should happen within days so that APIs are more stable we don't have to fix something new once again once it hits. |
How do you set Thanks |
try what @mratsim has mentioned above. for key, value in model_dict_clone.items(): Next cellstyle_model = Net(ngf=128) |
I fixed my issue, I went to NN packages in my python site packages dir and set |
I really appreciate the comments for fixing the compatibility issue for the code. I haven't worked on this project for a while. Could you consider providing a pull request to the master branch? Thanks a lot :) |
Thanks to @alvinwan for sharing the fixes. I have tried it and it worked for both |
I have been looking for this for 50 hours, thanks |
PyTorch 0.4.0 was released on April 24 and unfortunately the pre-trained weights from before are not compatible.
On the notebook I get
The text was updated successfully, but these errors were encountered: