Skip to content
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

Change To Pytorch Version: 1.3+ #20

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

S-HuaBomb
Copy link

Make the program runs well in Windows and Pytorch 1.3+.

`torch.nn.Parameter(d.get(41).weight.float())` Change to: `torch.nn.Parameter(torch.Tensor(d.modules[41].weight))`
`load_lua()` change to: `load()`
```python
cImg = Variable(contentImg, volatile=True)
sImg = Variable(styleImg, volatile=True)
```
Change to:
```python
with torch.no_grad():
    cImg = Variable(contentImg)
    sImg = Variable(styleImg)
```
Add an URL to download the model while one in China.
Copy link

@rigvedrs rigvedrs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Causing one error now

$ python3 WCT.py --cuda
Transferring in1.jpg
Traceback (most recent call last):
File "/Universal Style Transfer/PytorchWCT/WCT.py", line 110, in
styleTransfer(cImg,sImg,imname,csF)
File "/Universal Style Transfer/PytorchWCT/WCT.py", line 56, in styleTransfer
Im5 = wct.d5(csF5)
File "/home/anaconda3/envs/yolo/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/Universal Style Transfer/PytorchWCT/modelsNIPS.py", line 885, in forward
out = self.reflecPad15(x)
File "/home/anaconda3/envs/yolo/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/anaconda3/envs/yolo/lib/python3.10/site-packages/torch/nn/modules/padding.py", line 178, in forward
return F.pad(input, self.padding, 'reflect')
RuntimeError: Padding length too large

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants