jiawei-ren / BalancedMetaSoftmax-Classification

[NeurIPS 2020] Balanced Meta-Softmax for Long-Tailed Visual Recognition
https://github.com/jiawei-ren/BalancedMetaSoftmax
Other
135 stars 26 forks source link

Run Error #7

Closed YananGu closed 3 years ago

YananGu commented 3 years ago

Hi : when I run "python main.py --cfg ./config/CIFAR10_LT/balms_imba200.yaml", I encountered the following error:

Traceback (most recent call last): File "/data2/gyn/PycharmProjects/BalancedMetaSoftmax-Classification-main-ori/main.py", line 160, in training_model.train() File "/data2/gyn/PycharmProjects/BalancedMetaSoftmax-Classification-main-ori/run_networks.py", line 348, in train self.meta_forward(inputs, labels, verbose=step % self.training_opt['display_step'] == 0) File "/data2/gyn/PycharmProjects/BalancedMetaSoftmax-Classification-main-ori/run_networks.py", line 272, in meta_forward trainoutputs, = fmodel(features.detach()) File "/home/gyn/anaconda2/envs/BalanceSoftmax/lib/python3.6/site-packages/torch/nn/modules/module.py", line 532, in call result = self.forward(*input, kwargs) File "/home/gyn/anaconda2/envs/BalanceSoftmax/lib/python3.6/site-packages/higher/patch.py", line 460, in _patched_forward output = self.boxed_forward(*args, *kwargs) File "/home/gyn/anaconda2/envs/BalanceSoftmax/lib/python3.6/site-packages/higher/patch.py", line 387, in patched_forward return true_forward(self, args, kwargs) File "/home/gyn/anaconda2/envs/BalanceSoftmax/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 151, in forward replicas = self.replicate(self.module, self.device_ids[:len(inputs)]) File "/home/gyn/anaconda2/envs/BalanceSoftmax/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 156, in replicate return replicate(module, device_ids, not torch.is_grad_enabled()) File "/home/gyn/anaconda2/envs/BalanceSoftmax/lib/python3.6/site-packages/torch/nn/parallel/replicate.py", line 146, in replicate setattr(replica, key, Parameter(param)) File "/home/gyn/anaconda2/envs/BalanceSoftmax/lib/python3.6/site-packages/higher/patch.py", line 279, in setattr self.update_params(fast_params) File "/home/gyn/anaconda2/envs/BalanceSoftmax/lib/python3.6/site-packages/torch/nn/modules/module.py", line 576, in getattr type(self).name, name)) AttributeError: 'InnerFunctionalLinear' object has no attribute 'update_params'.

I have no idea about this error , can you give me some help?

jiawei-ren commented 3 years ago

May I know more about your environment setup, like torch version and higher version? This could be related to a known issue #2.

YananGu commented 3 years ago

The version of Pytorch is 1.4.0 and Higher is 0.2.1. When I set the number of GPU to 1, it works.

jiawei-ren commented 3 years ago

Higher does not seem to support multiple GPU training, referring to the issue discussed here.

YananGu commented 3 years ago

Got it, thanks for your help!