SunYW0108 / DeepWindows

PyTorch Implementation of DeepWindows
11 stars 5 forks source link

KeyError: 'Non-existent config key: MODEL.PROPOSAL_GENERATOR.GAM_TOPK' when running train_net.py #1

Open Nay-AbiAkl opened 2 years ago

Nay-AbiAkl commented 2 years ago

I installed all dependencies as requested and I am trying to train the DeepWindows network however I obtain this error. I have not made any changes to the repo. The error is the following:

Command Line Args: Namespace(config_file='./configs/CASARPN_RM_R_50_FPN_1x.yaml', dist_url='tcp://127.0.0.1:49152', eval_only=False, machine_rank=0, num_gpus=1, num_machines=1, opts=[], resume=False)
Traceback (most recent call last):
  File "train_net.py", line 216, in <module>
    args=(args,),
  File "/usr/local/lib/python3.7/dist-packages/detectron2/engine/launch.py", line 82, in launch
    main_func(*args)
  File "train_net.py", line 177, in main
    cfg = setup(args)
  File "train_net.py", line 89, in setup
    cfg.merge_from_file(args.config_file)
  File "/usr/local/lib/python3.7/dist-packages/detectron2/config/config.py", line 69, in merge_from_file
    self.merge_from_other_cfg(loaded_cfg)
  File "/usr/local/lib/python3.7/dist-packages/fvcore/common/config.py", line 132, in merge_from_other_cfg
    return super().merge_from_other_cfg(cfg_other)
  File "/usr/local/lib/python3.7/dist-packages/yacs/config.py", line 217, in merge_from_other_cfg
    _merge_a_into_b(cfg_other, self, self, [])
  File "/usr/local/lib/python3.7/dist-packages/yacs/config.py", line 478, in _merge_a_into_b
    _merge_a_into_b(v, b[k], root, key_list + [k])
  File "/usr/local/lib/python3.7/dist-packages/yacs/config.py", line 478, in _merge_a_into_b
    _merge_a_into_b(v, b[k], root, key_list + [k])
  File "/usr/local/lib/python3.7/dist-packages/yacs/config.py", line 491, in _merge_a_into_b
    raise KeyError("Non-existent config key: {}".format(full_key))
KeyError: 'Non-existent config key: MODEL.PROPOSAL_GENERATOR.GAM_TOPK'

Do you know what is happening? Thanks

Nay-AbiAkl commented 2 years ago

I fixed with what I think is a hack!

In the config.py file I added the line cfg.MODEL.PROPOSAL_GENERATOR.GAM_TOPK = False at the end of the function add_deepwindows_network_config. This added a dummy key that is used in the file merging later and removes the crash. I'm not sure that it's the optimal solution to the problem, but it's a temporary fix.

iamsiddhantsahu commented 1 year ago

@Nay-AbiAkl Thanks for this information. I was also getting the same error. Where you able to the train the models?