-
Notifications
You must be signed in to change notification settings - Fork 112
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
RuntimeError: Expected object of type torch.FloatTensor but found type torch.cuda.FloatTensor for argument #2 'weight' #46
Comments
Seems like you don’t have cuda enabled device |
I have cuda V9.0.176,pytorch 0.4.1 |
Could you check the value of args.gpu in main.py file? |
Also, this codebase doesn’t support PyTorch 0.4. Check software requirements |
Thanks for your help, it works for PyTorch 0.4 anyway. But another thing occurs when I finished training EspNet-C,I want to train ESPNet, but it says: |
What is the batch size? I used 6 for ESPNet |
Thanks for your help, it works. |
I run by this:python3 main.py --scaleIn 8 --p 2 --q 8 --onGPU True
then get:
Total network parameters: 344841
/home/hh/.local/lib/python3.5/site-packages/torch/nn/modules/loss.py:206: UserWarning: NLLLoss2d has been deprecated. Please use NLLLoss instead as a drop-in replacement and see http://pytorch.org/docs/master/nn.html#torch.nn.NLLLoss for more details.
warnings.warn("NLLLoss2d has been deprecated. "
Data statistics
[103.45756 101.83934 101.728714] [69.51785 67.936035 64.71613 ]
[4.2652993 1.5139731]
Learning rate: 0.0005
Traceback (most recent call last):
File "main.py", line 408, in
trainValidateSegmentation(parser.parse_args())
File "main.py", line 334, in trainValidateSegmentation
train(args, trainLoader_scale1, model, criteria, optimizer, epoch)
File "main.py", line 97, in train
output = model(input_var)
File "/home/hh/.local/lib/python3.5/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/home/hh/programs/ESPNet_hh/train/Model.py", line 286, in forward
output0 = self.level1(input)
File "/home/hh/.local/lib/python3.5/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/home/hh/programs/ESPNet_hh/train/Model.py", line 33, in forward
output = self.conv(input)
File "/home/hh/.local/lib/python3.5/site-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/home/hh/.local/lib/python3.5/site-packages/torch/nn/modules/conv.py", line 301, in forward
self.padding, self.dilation, self.groups)
RuntimeError: Expected object of type torch.FloatTensor but found type torch.cuda.FloatTensor for argument #2 'weight'
I followed by your code,and there is only one class for my dataset to segment. What happened to this porblem?How to change?
The text was updated successfully, but these errors were encountered: