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
(1)raise ValueError(reduction + " is not a valid value for reduction") (2)dists[c, n] = torch.dist(preds[n,c,:], target[n,c,:])/normalize[n] RuntimeError: Expected object of type torch.FloatTensor but found type torch.cuda.FloatTensor for argument #2 'other' #68
Comments
Specifically for bug 2,in the training phase,whencomputing the accuracy,we should ensure the variables are of the same type. |
Yes. I think the problem is caused by 0.4.1. Since |
OK,thanks.BTW,did you notice the second problem? |
Can you put the whole runtime error info here? |
Traceback (most recent call last): |
It's weird. I cannot reproduce the error. Also, we have already sent Did you use the latest update of this code? |
Close because of no further discussion. |
There are two bugs in the latest repo updated on Jan 8th,2019.The first one is as the title described.I think it is caused by the pytorch version 0.4.1 vs 1.0 .
I solved this problem by changing the param of the torch.nn.MSELoss() to 'size_average=True'
The second bug is :
'dists[c, n] = torch.dist(preds[n,c,:], target[n,c,:])/normalize[n]
RuntimeError: Expected object of type torch.FloatTensor but found type torch.cuda.FloatTensor for argument #2 'other''
It is caused by the type of the variable.I solved it by changing the type of variable 'target' from cuda() to cpu data.
The text was updated successfully, but these errors were encountered: