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

question about code #6

Open
xiaozibuqi opened this issue Oct 11, 2024 · 1 comment
Open

question about code #6

xiaozibuqi opened this issue Oct 11, 2024 · 1 comment

Comments

@xiaozibuqi
Copy link

An error occurs when I run the code:
Traceback (most recent call last):
File "basicsr/train.py", line 266, in
train_pipeline(root_path)
File "basicsr/train.py", line 211, in train_pipeline
model.optimize_parameters(current_iter)
File "/opt/data/private/wyh/UHDformer-main/basicsr/models/femasr_model.py", line 148, in optimize_parameters
l_g_total.mean().backward()
File "/root/anaconda3/envs/wdgan/lib/python3.6/site-packages/torch/_tensor.py", line 307, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph, inputs=inputs)
File "/root/anaconda3/envs/wdgan/lib/python3.6/site-packages/torch/autograd/init.py", line 156, in backward
allow_unreachable=True, accumulate_grad=True) # allow_unreachable flag
RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn
How do I fix it?

@supersupercong
Copy link
Owner

Please check your environment since there is not any issues in our environment.

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