CondenseNet icon indicating copy to clipboard operation
CondenseNet copied to clipboard

Error message: variables needed for gradient computation has been modified by an inplace operation

Open nauman46055 opened this issue 7 years ago • 1 comments

Hello dear brother, i am running condensenet and densent_LGC in pycahem IDE with Python 3.6.5 :: Anaconda, Inc. with following configurations: dataset - cifar10 epochs - 200 bottleneck - 3 growth - 12-12-12 C=G=4 batch size = 64

i am getting this error exactly at 34th epoch every time. i have tried to remove 'inplace addition operations' and ' inplace=True' from Relu, but nothing has worked . Can you please help, how can it be fixed. Regards

Epoch - 31 * Accuracy@1 89.150 Accuracy@5 99.520 Epoch - 32 * Accuracy@1 88.120 Accuracy@5 99.610 Epoch - 33 * Accuracy@1 88.640 Accuracy@5 99.630 Epoch - 34 Traceback (most recent call last): File "/home/supernet/PycharmProjects/untitled/nets/CondenseNet-Nauman/main.py", line 497, in main() File "/home/supernet/PycharmProjects/untitled/nets/CondenseNet-Nauman/main.py", line 257, in main train(train_loader, model, criterion, optimizer, epoch) File "/home/supernet/PycharmProjects/untitled/nets/CondenseNet-Nauman/main.py", line 340, in train loss.backward() File "/home/supernet/anaconda3/lib/python3.6/site-packages/torch/tensor.py", line 93, in backward torch.autograd.backward(self, gradient, retain_graph, create_graph) File "/home/supernet/anaconda3/lib/python3.6/site-packages/torch/autograd/init.py", line 89, in backward allow_unreachable=True) # allow_unreachable flag RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation

nauman46055 avatar Aug 15 '18 13:08 nauman46055

Sorry for being late. Could you show me the command you use to train? The pytorch API changed a lot since 0.2, so I am planning to re-check the code recently to make sure it fits 0.4.

ShichenLiu avatar Sep 15 '18 17:09 ShichenLiu