mit-han-lab / temporal-shift-module

[ICCV 2019] TSM: Temporal Shift Module for Efficient Video Understanding
https://arxiv.org/abs/1811.08383
MIT License
2.07k stars 417 forks source link

[Resolved] Error while training with Mobilenet Architecture #145

Closed Nauman007 closed 4 years ago

Nauman007 commented 4 years ago

I am facing this error while training with mobilenet architecture...any solutions..?

ucf101: 6 classes storing name: TSM_ucf101_RGB_mobilenetv2_shift8_blockres_avg_segment8_e25 creating folder log creating folder checkpoint creating folder log/TSM_ucf101_RGB_mobilenetv2_shift8_blockres_avg_segment8_e25 creating folder checkpoint/TSM_ucf101_RGB_mobilenetv2_shift8_blockres_avg_segment8_e25

Initializing TSN with base model: mobilenetv2.
TSN Configurations:
    input_modality:     RGB
    num_segments:       8
    new_length:         1
    consensus_module:   avg
    dropout_ratio:      0.8
    img_feature_dim:    256

=> base model: mobilenetv2 Downloading: "https://www.dropbox.com/s/47tyzpofuuyyv1b/mobilenetv2_1.0-f2a8633.pth.tar?dl=1" to /root/.cache/torch/hub/checkpoints/mobilenetv2_1.0-f2a8633.pth.tar 100% 13.5M/13.5M [00:00<00:00, 64.8MB/s] Traceback (most recent call last): File "/content/temporal-shift-module/main.py", line 378, in main() File "/content/temporal-shift-module/main.py", line 65, in main non_local=args.non_local) File "/content/temporal-shift-module/ops/models.py", line 59, in init self._prepare_base_model(base_model) File "/content/temporal-shift-module/ops/models.py", line 144, in _prepare_base_model if self.print_spec: File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 772, in getattr type(self).name, name)) torch.nn.modules.module.ModuleAttributeError: 'TSN' object has no attribute 'print_spec

yushuinanrong commented 3 years ago

How did you resolve this issue?

Nauman007 commented 3 years ago

Hi, good day go to models.py file stored in ops folder and add line# 35 to models.py file image