blur-diffusion
blur-diffusion copied to clipboard
AttributeError: 'EMA' object has no attribute 'defaults'`
Hello , thank you for the code.
I get a AttributeError when i want to train the model:
Traceback (most recent call last): File "main.py", line 292, in <module> optimizer.zero_grad() File "/home/extradisk/miniconda3/envs/sr3/lib/python3.8/site-packages/torch/optim/optimizer.py", line 231, in zero_grad foreach = self.defaults.get('foreach', False) AttributeError: 'EMA' object has no attribute 'defaults'
Could you help me with this bug ?
Hi,
I wonder if you solved this problem because I have the same issue.
Best,
https://github.com/sangyun884/fast-ode/blob/master/EMA.py
Try this code instead, and let me know if it works.
File "E:\anaconda\envs\torch\lib\site-packages\torch\utils\data\sampler.py", line 225, in init raise ValueError("batch_size should be a positive integer value, " ValueError: batch_size should be a positive integer value, but got batch_size=0
https://github.com/sangyun884/fast-ode/blob/master/EMA.py
Try this code instead, and let me know if it works.
Unfortunately with your code I've got
AttributeError: 'EMA' object has no attribute '_optimizer_step_pre_hooks'. Did you mean: '_optimizer_step_code'?
https://github.com/sangyun884/fast-ode/blob/master/EMA.py Try this code instead, and let me know if it works.
Unfortunately with your code I've got
AttributeError: 'EMA' object has no attribute '_optimizer_step_pre_hooks'. Did you mean: '_optimizer_step_code'?
Any solution to this problem?
Can you try PyTorch version of 1.11.0 or higher?