【论文复现】clear_gradients() 报错 TypeError: 'NoneType' object is not iterable
Created by: Ryan906k9
Traceback (most recent call last):
File "main.py", line 94, in <module>
main()
File "main.py", line 86, in main
gan.train()
File "/home/aistudio/UGATIT.py", line 338, in train
self.D_optim.clear_gradients()
File "</opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/decorator.py:decorator-gen-59>", line 2, in clear_gradients
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/wrapped_decorator.py", line 25, in __impl__
return wrapped_func(*args, **kwargs)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/framework.py", line 216, in __impl__
return func(*args, **kwargs)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/optimizer.py", line 791, in clear_gradients
for p in self._parameter_list:
TypeError: 'NoneType' object is not iterable
请问这个报错可能是什么导致的?