kenshohara / 3D-ResNets-PyTorch

3D ResNets for Action Recognition (CVPR 2018)
MIT License
3.9k stars 932 forks source link

build resnext model raise argument error #192

Closed holyYodu closed 4 years ago

holyYodu commented 4 years ago

File "main.py", line 431, in main_worker(-1, opt) File "main.py", line 337, in main_worker model = generate_model(opt) File "/home/mhy/Documents/3D-ResNets-PyTorch/model.py", line 76, in generate_model no_max_pool=opt.no_max_pool) File "/home/mhy/Documents/3D-ResNets-PyTorch/models/resnext.py", line 67, in generate_model **kwargs) File "/home/mhy/Documents/3D-ResNets-PyTorch/models/resnext.py", line 54, in init shortcut_type, n_classes) File "/home/mhy/Documents/3D-ResNets-PyTorch/models/resnet.py", line 132, in init shortcut_type) File "/home/mhy/Documents/3D-ResNets-PyTorch/models/resnet.py", line 189, in _make_layer downsample=downsample)) TypeError: init() got an unexpected keyword argument 'in_planes'

when build the resnext model , the block in super().init() is 'ResNeXtBottleneck' while in resnet.py make_layer code is

        layers.append(
            block(in_planes=self.in_planes,
                  planes=planes,
                  stride=stride,
                  downsample=downsample))

the in_planes is a wrong argument for ResNeXtBottleneck

balabanahei commented 4 years ago

hello! I meet the same problem. so how do you solve it?

holyYodu commented 4 years ago

hello! I meet the same problem. so how do you solve it?

replace "inplanes" with "in_planes" in "class ResNeXtBottleneck(Bottleneck):" from models/resnext.py

balabanahei commented 4 years ago

thanks, i try that, and it was killed by system. Maybe out of memory.