Closed berylyellow closed 5 years ago
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:
python3 main.py --scaleIn 1 --p 2 --q 8 --decoder True --pretrained ../pretrained/encoder/espnet_p_2_q_8.pth
Encoder loaded!
Total network parameters: 365109
/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 10.492059 10.492059 10.492059 10.492059 10.492059
10.492059 10.492059 10.492059 10.492059 10.492059 10.492059
10.492059 10.492059 10.492059 10.492059 10.492059 10.492059
10.492059 1.5139731]
Learning rate: 0.0005
Traceback (most recent call last):
File "main.py", line 415, in
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?