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: A view was created in no_grad mode and is being modified inplace with grad mode enabled. This view is the output of a function that returns multiple views. Such functions do not allow the output views to be modified inplace. You should replace the inplace operation by an out-of-place one #25

Open rutuja1409 opened 3 years ago

rutuja1409 commented 3 years ago

Hello @Jakaria08 I'm getting this error. Can you help me solve this ?

21-05-02 10:35:50.553 - INFO: Total epochs needed: 736 for iters 400,000 2021-05-02 10:35:50.717038: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0 21-05-02 10:35:51.840 - INFO: Start training from epoch: 0, iter: 0 Traceback (most recent call last): File "/content/drive/MyDrive/Project/EESRGAN/train.py", line 94, in main(config) File "/content/drive/MyDrive/Project/EESRGAN/train.py", line 73, in main trainer.train() File "/content/drive/MyDrive/Project/EESRGAN/trainer/cowc_GAN_FRCNN_trainer.py", line 83, in train self.model.optimize_parameters(current_step) File "/content/drive/MyDrive/Project/EESRGAN/model/ESRGAN_EESN_FRCNN_Model.py", line 234, in optimize_parameters loss_dict = self.netFRCNN(self.intermediate_img, self.targets) File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, *kwargs) File "/usr/local/lib/python3.7/dist-packages/torchvision/models/detection/generalized_rcnn.py", line 78, in forward images, targets = self.transform(images, targets) File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(input, **kwargs) File "/usr/local/lib/python3.7/dist-packages/torchvision/models/detection/transform.py", line 110, in forward images = self.batch_images(images) File "/usr/local/lib/python3.7/dist-packages/torchvision/models/detection/transform.py", line 215, in batch_images padimg[: img.shape[0], : img.shape[1], : img.shape[2]].copy(img)

Above is the error i'm getting. Can you help me ?

Githopp commented 3 years ago

For me Pytorch 1.1.0 solved these error (check requirements.txt).

KZGSK commented 2 years ago

@rutuja1409 Were you able to fix this issue? I'm getting the same error.

YanADingggg commented 2 years ago

Hello, may I ask if you have solved this problem? Now I have the same problem and I would like to ask for help. Thank you very much @weichen5926 @rutuja1409 @Githopp

KZGSK commented 2 years ago

Hi, I'm sorry to reply you so late.I think it's a Pytorch version problem. For me Pytorch1.2 and 1.10 solved these error. But,you can change "self.intermediate_img = self.final_SR" to“self.intermediate_img = self.final_SR.detach()”.In this way, no error can be reported,but there may be potential problems.I didn't continue to verify. Good luck! @YanADingggg