CSAILVision / places365

The Places365-CNNs for Scene Classification
http://places2.csail.mit.edu/
MIT License
1.93k stars 537 forks source link

AttributeError: 'module' object has no attribute 'constant_' #51

Closed chenliqiong closed 6 years ago

chenliqiong commented 6 years ago

Hello,everyone! Running run_placesCNN_unified.py in this repository I run into this following error:

Traceback (most recent call last): File "run_placesCNN_unified.py", line 124, in model = load_model() File "run_placesCNN_unified.py", line 94, in load_model model = wideresnet.resnet18(numclasses=365) File "/home/user/zou/code/places365/wideresnet.py", line 164, in resnet18 model = ResNet(BasicBlock, [2, 2, 2, 2], **kwargs) File "/home/user/zou/code/places365/wideresnet.py", line 120, in init nn.init.constant(m.weight, 1) AttributeError: 'module' object has no attribute 'constant_'

Any advice about that? Thanks in advance!

chenliqiong commented 6 years ago

I solved this by change 'constant_' to 'constant'. Thanks for the author's great work.