tianzhi0549 / FCOS

FCOS: Fully Convolutional One-Stage Object Detection (ICCV'19)
https://arxiv.org/abs/1904.01355
Other
3.28k stars 630 forks source link

KeyError: 'Non-existent config key: MODEL.FCOS.NORM_REG_TARGETS' #244

Open KopiSoftware opened 4 years ago

KopiSoftware commented 4 years ago
python -m torch.distributed.launch \
>     --nproc_per_node=1 \
>     tools/train_net.py \
> --config-file configs/fcos/fcos_imprv_R_50_FPN_1x.yaml \
>     DATALOADER.NUM_WORKERS 1 \
>     OUTPUT_DIR training_dir/fcos_imprv_R_50_FPN_1x
Traceback (most recent call last):
  File "tools/train_net.py", line 180, in <module>
    main()
  File "tools/train_net.py", line 152, in main
    cfg.merge_from_file(args.config_file)
  File "/home/kyle/anaconda3/lib/python3.7/site-packages/yacs/config.py", line 213, in merge_from_file
    self.merge_from_other_cfg(cfg)
  File "/home/kyle/anaconda3/lib/python3.7/site-packages/yacs/config.py", line 217, in merge_from_other_cfg
    _merge_a_into_b(cfg_other, self, self, [])
  File "/home/kyle/anaconda3/lib/python3.7/site-packages/yacs/config.py", line 460, in _merge_a_into_b
    _merge_a_into_b(v, b[k], root, key_list + [k])
  File "/home/kyle/anaconda3/lib/python3.7/site-packages/yacs/config.py", line 460, in _merge_a_into_b
    _merge_a_into_b(v, b[k], root, key_list + [k])
  File "/home/kyle/anaconda3/lib/python3.7/site-packages/yacs/config.py", line 473, in _merge_a_into_b
    raise KeyError("Non-existent config key: {}".format(full_key))
KeyError: 'Non-existent config key: MODEL.FCOS.NORM_REG_TARGETS'
Traceback (most recent call last):
  File "/home/kyle/anaconda3/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/kyle/anaconda3/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/kyle/anaconda3/lib/python3.7/site-packages/torch/distributed/launch.py", line 263, in <module>
    main()
  File "/home/kyle/anaconda3/lib/python3.7/site-packages/torch/distributed/launch.py", line 259, in main
    cmd=cmd)
subprocess.CalledProcessError: Command '['/home/kyle/anaconda3/bin/python', '-u', 'tools/train_net.py', '--local_rank=0', '--config-file', 'configs/fcos/fcos_imprv_R_50_FPN_1x.yaml', 'DATALOADER.NUM_WORKERS', '1', 'OUTPUT_DIR', 'training_dir/fcos_imprv_R_50_FPN_1x']' returned non-zero exit status 1.

My GPU is 1060 6G version and I installed pytorch1.4. Should I return to torch1.0.1 to avoid this problem?

KopiSoftware commented 4 years ago

I have found the solution. Simply comment out non-existent config keys, which seems useless in this step. Here are the prove of my solution: The error still exists while the key is added in training command(displayed below). So I comment all these keys(3 altogether) and it works.

python -m torch.distributed.launch \
>     --nproc_per_node=1 \
>     tools/train_net.py \
> --config-file configs/fcos/fcos_imprv_R_50_FPN_1x.yaml \
>     MODEL.FCOS.NORM_REG_TARGETS True
>     DATALOADER.NUM_WORKERS 1 \
>     OUTPUT_DIR training_dir/fcos_imprv_R_50_FPN_1x
KopiSoftware commented 4 years ago

Well,I think I made a mistake. The reason why the problem appears is that I downloaded the code from git while compiled and installed fcos with Tsinghua source. However the code from the source ain't the latest. So even if you commen out thses keys, it still doesn't work.