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

got error, could you give me some help? #8

Closed
passion3394 opened this issue Jan 17, 2019 · 11 comments
Closed

got error, could you give me some help? #8

passion3394 opened this issue Jan 17, 2019 · 11 comments

Comments

@passion3394
Copy link

Traceback (most recent call last):
File "demo.py", line 17, in
MORAN = MORAN.cuda()
File "/root/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 258, in cuda
return self._apply(lambda t: t.cuda(device))
File "/root/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 185, in _apply
module._apply(fn)
File "/root/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 185, in _apply
module._apply(fn)
File "/root/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 185, in _apply
module._apply(fn)
File "/root/anaconda3/lib/python3.6/site-packages/torch/nn/modules/rnn.py", line 112, in _apply
self.flatten_parameters()
File "/root/anaconda3/lib/python3.6/site-packages/torch/nn/modules/rnn.py", line 105, in flatten_parameters
self.batch_first, bool(self.bidirectional))
RuntimeError: CuDNN error: CUDNN_STATUS_SUCCESS

@Canjie-Luo
Copy link
Owner

There is something wrong with your CuDNN. Does it work when you run other repos?

@passion3394
Copy link
Author

@Canjie-Luo my environment is : pytorch0.4.1 + python3.6 + cuda10.0+cudnn7.3.1, is that ok for this code?

@Canjie-Luo
Copy link
Owner

No, please ref to https://github.com/Canjie-Luo/MORAN_v2#requirements. Please use PyTorch0.3.

@passion3394
Copy link
Author

maybe PyTorch0.3 is a little old, what's the question of the env "pytorch0.4.1 + python3.6 + cuda10.0+cudnn7.3.1" ?

@Canjie-Luo
Copy link
Owner

Sorry for that. I completed the experiments and submitted the paper one year ago. So the repo was developed under PyTorch0.2, and I upgraded it to 0.3.1 now. There seems some bugs in tools/utils.py due to the merging of Tensor and Variable in PyTorch0.4.

@passion3394
Copy link
Author

I use another machine to run the demo.py. the env: pytorch0.4.1 + cuda9.0 + cudnn7.1. got the following error:

/home/hs/anaconda3/lib/python3.6/site-packages/torch/nn/functional.py:1961: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
"See the documentation of nn.Upsample for details.".format(mode))
Traceback (most recent call last):
File "demo.py", line 49, in
output = MORAN(image, length, text, text, test=True, debug=True)
File "/home/hs/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/home/hs/code/MORAN_v2/models/moran.py", line 16, in forward
x_rectified, demo = self.MORN(x, test, debug=debug)
File "/home/hs/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/home/hs/code/MORAN_v2/models/morn.py", line 109, in forward
img_offsets = (offsets_grid[i]).view(1, self.targetH, self.targetW).data.cpu().add_(-v_min).mul_(1./(v_max-v_min))
RuntimeError: Expected object of type torch.FloatTensor but found type torch.cuda.FloatTensor for argument #4 'other'

@passion3394
Copy link
Author

@Canjie-Luo thanks for your explaining. how to fix this problem?

@Canjie-Luo
Copy link
Owner

I added an option for CUDA and updated the repo just now. Please try the new one with --cuda off.

@passion3394
Copy link
Author

@Canjie-Luo ok,thanks very much, I will update the code and try it

@passion3394
Copy link
Author

@Canjie-Luo I have try the new code, the code could run in cpu mode

@Canjie-Luo
Copy link
Owner

So the problem is from your CUDA environment~

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

No branches or pull requests

2 participants