hassony2 / inflated_convnets_pytorch

Inflate DenseNet and ResNet as per I3D with ImageNet weight transfer
MIT License
143 stars 21 forks source link

Densenet 169 doesn't load the example. #7

Open andimarafioti opened 3 years ago

andimarafioti commented 3 years ago

When I try to load the example with densenet 169 I get the following traceback:

` python inflate_densenet.py --densenet_nb 169

Traceback (most recent call last): File "/Users/andimarafioti/Documents/code/inflated_convnets_pytorch/inflate_densenet.py", line 113, in run_inflater(args) File "/Users/andimarafioti/Documents/code/inflated_convnets_pytorch/inflate_densenet.py", line 43, in run_inflater i3densenet = I3DenseNet( File "/Users/andimarafioti/Documents/code/inflated_convnets_pytorch/src/i3dense.py", line 15, in init self.features, transition_nb = inflate_features( File "/Users/andimarafioti/Documents/code/inflated_convnets_pytorch/src/i3dense.py", line 121, in inflate_features _DenseLayer3d( File "/Users/andimarafioti/Documents/code/inflated_convnets_pytorch/src/i3dense.py", line 53, in init self.add_module('padding.1', pad_time) File "/Users/andimarafioti/miniforge3/envs/torchless/lib/python3.9/site-packages/torch/nn/modules/module.py", line 380, in add_module raise KeyError("module name can't contain \".\", got: {}".format(name)) KeyError: 'module name can\'t contain ".", got: padding.1' `

andimarafioti commented 3 years ago

According to https://github.com/pytorch/vision/issues/809, "." are no longer allowed in module names.

Changing the "." to "-" fixes the issue.