wuhuikai / FastFCN

FastFCN: Rethinking Dilated Convolution in the Backbone for Semantic Segmentation.
http://wuhuikai.me/FastFCNProject
Other
838 stars 148 forks source link

Error in execution of training script - model.jpu is empty #69

Closed sfaroy closed 4 years ago

sfaroy commented 4 years ago

Hi,

When trying to execute the training in the latest version 126661b0eb6053ce35b3c778a7d402f0338d98b7

I receive the following error:

Traceback (most recent call last):
EncNet(
  File "/opt/anaconda3/lib/python3.6/runpy.py", line 193, in _run_module_as_main
  (pretrained): ResNet(
    "__main__", mod_spec)
    (conv1): Sequential(
  File "/opt/anaconda3/lib/python3.6/runpy.py", line 85, in _run_code
      (0): Conv2d(3, 64, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)
    exec(code, run_globals)
      (1): SyncBatchNorm(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  File "/home/roee/work/segmentation/github/FastFCN/experiments/segmentation/train.py", line 176, in <module>
      (2): ReLU(inplace)
    trainer = Trainer(args)
      (3): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
      (4): SyncBatchNorm(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  File "/home/roee/work/segmentation/github/FastFCN/experiments/segmentation/train.py", line 60, in __init__
      (5): ReLU(inplace)
    params_list.append({'params': model.jpu.parameters(), 'lr': args.lr*10})
      (6): Conv2d(64, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
AttributeError: 'NoneType' object has no attribute 'parameters'

Any idea why?

wuhuikai commented 4 years ago

Change thin line to if model.jpu is not None:.