Skip to content

Conversation

@S-HuaBomb
Copy link

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

S-HuaBomb added 4 commits May 11, 2020 23:53
`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.

3 participants