han-cai / PathLevel-EAS

Path-Level Network Transformation for Efficient Architecture Search, in ICML 2018.
113 stars 21 forks source link

AttributeError: 'NoneType' object has no attribute 'named_modules' #9

Closed Yuzz1020 closed 6 years ago

Yuzz1020 commented 6 years ago

I have implemented the program as you instructed, first, I have downloaded the model you provided in the repo, then I run the code run_exp.py with following command.

python run_exp.py --path=/home/zzyu/CIFAR10#PyramidTreeCellA#N\=18_alpha\=84#300/

it return the error:

AttributeError: 'NoneType' object has no attribute 'named_modules'

The traceback are as follows,

Traceback (most recent call last): File "run_exp.py", line 35, in resume=args.resume) File "/home/zzyu/Desktop/PathLevel-EAS-master/code/CIFAR/expdir_monitor/expdir_monitor.py", line 144, in run run_manager = RunManger(self.expdir, model, run_config, out_log=(not pure), resume=resume) File "/home/zzyu/Desktop/PathLevel-EAS-master/code/CIFAR/models/run_manager.py", line 205, in init self.model.init_model(run_config.model_init, run_config.init_div_groups) File "/home/zzyu/Desktop/PathLevel-EAS-master/code/CIFAR/models/utils.py", line 182, in init_model for m in self.modules(): File "/home/zzyu/anaconda2/envs/py36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 412, in modules for name, module in self.named_modules(): File "/home/zzyu/anaconda2/envs/py36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 441, in named_modules for m in module.named_modules(memo, submodule_prefix): File "/home/zzyu/anaconda2/envs/py36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 441, in named_modules for m in module.named_modules(memo, submodule_prefix): File "/home/zzyu/anaconda2/envs/py36/lib/python3.6/site-packages/torch/nn/modules/module.py", line 441, in named_modules for m in module.named_modules(memo, submodule_prefix): [Previous line repeated 5 more times] AttributeError: 'NoneType' object has no attribute 'named_modules'

It seems that in /models/utils.py, line 181 def init_model, the self.modules has missing something... But I just don't know how to fix this.

Yuzz1020 commented 6 years ago

It caused by the version of pytorch, when I changed to pytorch 0.4, this error no longer exists