SGNAS icon indicating copy to clipboard operation
SGNAS copied to clipboard

when train_cifar.py is running, there is some error.

Open MachineCF opened this issue 3 years ago • 3 comments

Error: Traceback (most recent call last): File "/home/lcf/project/SGNAS/train_cifar.py", line 97, in arch_param = generator(prior, normalize_hardware_constraint, noise) File "/home/lcf/anaconda3/envs/DALLE/lib/python3.6/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) TypeError: forward() takes 3 positional arguments but 4 were given

Code:

arch_param = generator(prior, normalize_hardware_constraint, noise) def forward(self, x, hc): y = x.view(1, 1, *x.shape) .......... return y TypeError: forward() takes 3 positional arguments but 4 were given

MachineCF avatar Jan 02 '22 08:01 MachineCF

Hello, I'm one of the users.

I faced the same problem as you. However, the problem can be solved easily. If the last argument, noise, is removed, the code will work normally.

For example, [before] arch_param = generator(prior, normalize_hardware_constraint, noise)

[after] arch_param = generator(prior, normalize_hardware_constraint)

I hope you have a good day. 😊

sungwool avatar Apr 04 '22 05:04 sungwool

thank god,it takes me a lot of time

yiyi9527 avatar May 19 '22 09:05 yiyi9527

Sorry for the late reply, and thanks for the Sungwool's response.

If there is any question, please feel free to let me know. Thank you.

I have pushed a new version to fix this error. Sorry again

eric8607242 avatar May 19 '22 10:05 eric8607242