-
Notifications
You must be signed in to change notification settings - Fork 965
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
New error (sadly) #981
Comments
have you made sure that your model is typecasted to CUDA (or that your input is Float?) |
yes it is |
Same problem for ClassNLLCriterion after the update. (It worked fine until yesterday.) |
@supakjk update nn and cunn both. |
@holgafreak can you give a small test case for this? |
@soumith after updating nn and cunn everything goes ok with my code. |
Even after updating nn and cunn, mine still doesn't work. require 'nn' The CPU version works without problem but the following code (CUDA version) produces the error message I mentioned above. require 'cunn' |
I was trying this tutorial of torch and was trying to execute CNN for cifar10 given on the page and I encountered a similar error... Please help stack traceback: |
The problem seems because the target variable is not correctly set to be a CudaLongTensor. |
Hi supakjk: I have the same error and torch/lua is new to me. Could you explain where I add the code for your temporary solution? Is it in the module(s) listed in the error or the lua script I'm trying to run, or both? An example would be appreciated. Thanks Error: /home/gentxt/torch/install/share/lua/5.1/nn/THNN.lua:110: bad argument #3 to 'v' (cannot convert 'struct THCudaTensor *' to 'struct THCudaLongTensor *') Torch/lua works fine with torch-rnn, https://github.com/karpathy/char-rnn etc. but doesn't work with the current code I'm trying to run. I've updated everything and the error continues. |
I mean, when you get an instance of the cuda version of ClassNLLCriterion, change the target field of that instance to be a CudaLongTensor (probably initially a CudaTensor) |
it is automatically done in the source code: https://github.com/torch/nn/blob/master/ClassNLLCriterion.lua#L36 |
actually, i realized that i missed the non-batch case. I'm fixing it now. |
this should be fixed now in master, and reinstalling the "nn" package will make it go away. luarocks install nn |
This still breaks for me, after updating. The code posted by @supakjk above gives the same error. torch.cudaLong is nil for me. Do you mean: self.target = target.cudaLong and self.target:cudaLong() or self.target:cuda() |
It should be torch.CudaLong (not torch.cudaLong.) |
Don't think so. target.cudaLong checks to make sure the conversion function is present for the tensor. Possibly 'torch.CudaLongTensor' could serve the same purpose, but indirectly. torch.CudaLong is still nil. |
My mistake. I mean torch.CudaLongTensor. |
That's a little surprising. There was a first fix that should have worked, but broke compatibility when there was no CudaLong. The next update seems to have rebroken the initial issue (at least for me), because of the typo. If you update nn, it works for you? |
there was my patch which was the attempted fix. then @mys007 sent a fix for back-compat, but it was broken. i then pushed another fix on top of his fix that keeps back-compat and works for master too. |
if you now update nn, it should (fingers-crossed) work for you |
Seems good now. Thanks. |
When I rebuild cunn, I get the following: [ 14%] Building NVCC (Device) object lib/THCUNN/CMakeFiles/THCUNN.dir/THCUNN_generated_SpatialDilatedConvolution.cu.o 1 error detected in the compilation of "/tmp/tmpxft_00003e0f_00000000-7_RReLU.cpp1.ii". make[2]: *** [lib/THCUNN/CMakeFiles/THCUNN.dir/THCUNN_generated_RReLU.cu.o] Error 1 Error: Build error: Failed building. Any suggestions? |
@uahsan3 this comes because of an outdated cutorch version. |
@soumith thanks! |
Hi, I use nn.LookupTable module , but came accross the similiar error above, can anyone fix this? |
my erorr message is below: |
an i have update my torch, nn, cutorch, cunn to the latest versions. any idea? |
@eriche2016 pass a |
@fmassa Still, i got the same error when doing backward pass. Below is the test code, check it.
|
@eriche2016 It seems that you don't have the latest |
@fmassa I update my nn with command below: |
@eriche2016 Then I don't understand your error message. The |
@eriche2016 there seems to be something wrong with your setup. The error message that you show corresponds to a line of comment. |
Oh, i got it, the error its sit on the file in: |
@fmassa thank u very much for your patience. problem solved |
got further, but noiw this one:
In 1 module of nn.Sequential:
/home/xxx/torch/install/share/lua/5.1/nn/THNN.lua:110: bad argument #3 to 'v' (cannot convert 'struct THCudaTensor *' to 'struct THFloatTensor *')
stack traceback:
[C]: in function 'v'
/home/xxx/torch/install/share/lua/5.1/nn/THNN.lua:110: in function 'SpatialConvolutionMM_updateOutput'
...in/torch/install/share/lua/5.1/nn/SpatialConvolution.lua:96: in function <...in/torch/install/share/lua/5.1/nn/SpatialConvolution.lua:92>
yesterday didn't have this error either
-m
The text was updated successfully, but these errors were encountered: