Skip to content
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

RuntimeError #13

Open
0317lwj opened this issue Sep 20, 2024 · 0 comments
Open

RuntimeError #13

0317lwj opened this issue Sep 20, 2024 · 0 comments

Comments

@0317lwj
Copy link

0317lwj commented Sep 20, 2024

Hellow,I ran the train.py file but encountered the following problem.How do I fix it?

dataset is HT21, images num is 5312
train/HT21-01
Using /home/liuwenjie/.cache/torch_extensions/py38_cu118 as PyTorch extensions root...
Detected CUDA files, patching ldflags
Emitting ninja build file /home/liuwenjie/.cache/torch_extensions/py38_cu118/_prroi_pooling/build.ninja...
Building extension module _prroi_pooling...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
ninja: no work to do.
Loading extension module _prroi_pooling...
Traceback (most recent call last):
File "train.py", line 313, in
cc_trainer.forward()
File "train.py", line 50, in forward
self.train()
File "train.py", line 86, in train
all_loss.backward()
File "/home/liuwenjie/anaconda3/envs/DRNet2/lib/python3.8/site-packages/torch/_tensor.py", line 487, in backward
torch.autograd.backward(
File "/home/liuwenjie/anaconda3/envs/DRNet2/lib/python3.8/site-packages/torch/autograd/init.py", line 200, in backward
Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [4, 128, 96, 128]], which is output 0 of ReluBackward0, is at version 1; expected version 0 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@0317lwj and others