You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to freeze the model and train the input noise only, but failed. Here is a simple example that relies on the MSE loss of output images and labels to update noise:
loss.grad_fn The output is None, and the following error message is displayed:
Traceback (most recent call last):
File "D:\Exp\AIGC\DOV\mytest.py", line 118, in <module>
loss.backward()
File "D:\anaconda3\envs\py39-torch111\lib\site-packages\torch\_tensor.py", line 363, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph, inputs=inputs)
File "D:\anaconda3\envs\py39-torch111\lib\site-packages\torch\autograd\__init__.py", line 173, in backward
Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass
RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I tried to freeze the model and train the input noise only, but failed. Here is a simple example that relies on the MSE loss of output images and labels to update noise:
loss.grad_fn The output is None, and the following error message is displayed:
How can I solve this problem?
Beta Was this translation helpful? Give feedback.
All reactions