Strange error when running my model in double data type


(JxGu) #1

I am trying to run the LeNet5 model in the double data type but got this strange error:

Traceback (most recent call last):
  File "main_double.py", line 152, in <module>
    train(epoch+1)
  File "main_double.py", line 120, in train
    loss.backward()
  File "/home/***/anaconda2/lib/python2.7/site-packages/torch/autograd/variable.py", line 167, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph, retain_variables)
  File "/home/***/anaconda2/lib/python2.7/site-packages/torch/autograd/__init__.py", line 99, in backward
    variables, grad_variables, retain_graph)
RuntimeError: saved_variables() needed but not implemented in N5torch8autograd14AccumulateGradE

To run the model in the double type, I transformed both the input data and model to .double(). I am wondering what I should do to run the model in the double data type other than the default float type?


(Alban D) #2

Hi,

This should not happen… Could you provide us with some code to reproduce the problem on our side please?