Jakaria08 / EESRGAN

Small-Object Detection in Remote Sensing (satellite) Images with End-to-End Edge-Enhanced GAN and Object Detector Network
GNU General Public License v3.0
279 stars 70 forks source link

RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation #14

Closed anubhav1997 closed 3 years ago

anubhav1997 commented 3 years ago

I am getting the following error in the code on running the following command.

$ python train.py -c config_GAN.json

Traceback (most recent call last): File "train.py", line 101, in main(config) File "train.py", line 80, in main trainer.train() File "/home/jovyan/EESRGAN/trainer/cowc_GAN_FRCNN_trainer.py", line 88, in train self.model.optimize_parameters(current_step) File "/home/jovyan/EESRGAN/model/ESRGAN_EESN_FRCNN_Model.py", line 243, in optimize_parameters losses.backward() File "/opt/conda/lib/python3.7/site-packages/torch/tensor.py", line 198, in backward torch.autograd.backward(self, gradient, retain_graph, create_graph) File "/opt/conda/lib/python3.7/site-packages/torch/autograd/init.py", line 100, in backward allow_unreachable=True) # allow_unreachable flag RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [3, 64, 3, 3]] is at version 3; expected version 2 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).

I have torch version 1.6.0 and torchvision version 0.6

Jakaria08 commented 3 years ago

Check this issue: https://github.com/Jakaria08/EESRGAN/issues/9#issue-621570745