Open ak9250 opened 5 years ago
Traceback (most recent call last): File "tools/train_net.py", line 171, in main() File "tools/train_net.py", line 143, in main cfg.merge_from_file(args.config_file) File "/usr/local/lib/python3.6/dist-packages/yacs/config.py", line 213, in merge_from_file self.merge_from_other_cfg(cfg) File "/usr/local/lib/python3.6/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.6/dist-packages/yacs/config.py", line 460, in _merge_a_into_b _merge_a_into_b(v, b[k], root, key_list + [k]) File "/usr/local/lib/python3.6/dist-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.PRETRAINED_MODELS'
I have updated my pre-trained models in README.md. You can download the pre-trained models and put them in the pretrained_models dir.
I have put both the R-101.pkl and R-50.pkl files in the pretrained directory and still getting the same error
@ak9250 so have you solved that error? I got the same error.
@ak9250 I solved the problem. Just add the "key=value" to the correct place of PY file ~/maskscoring_rcnn/maskrcnn_benchmark/config/defaults.py. For example, add "_C.MODEL.PRETRAINED_MODELS = 'pretrained_models'" on line 24.
@maomaochongchh did you delete what was on line 24 and then add that now i am getting
Traceback (most recent call last):
File "/content/maskscoring_rcnn/tools/train_net.py", line 8, in
@ak9250 No, just add a line. As for your new error, I think you should make sure that you run it in correct environment and path. And if you want to know clearly why the previous error happened, you should spent sometime to see the function "merge_from_file()".
I added "_C.MODEL.PRETRAINED_MODELS = 'pretrained_models'",but still got error. _pickle.UnpicklingError: invalid load key, '<'.
@aguang1201 I got the same error when loading the model.
Mask-RCNN/maskscoring_rcnn-master/maskrcnn_benchmark/utils/c2_model_loading.py in _load_c2_pickled_weights(file_path)
122 with open(file_path, "rb") as f:
123 if torch._six.PY3:
--> 124 data = pickle.load(f, encoding="latin1")
125 else:
126 data = pickle.load(f)
UnpicklingError: invalid load key, '<'.
I found this is path problem. The file-path in the code is like './pretrained_model/***'. So you have to put your Jupiter/script file in the same director as pre_train folder.
I got the another error. KeyError: 'Non-existent config key: MODEL.MASKIOU_ON'
Hey @13012476909 Did you solve it? I’m getting the same error
The issue still persists. Has anyone solved it?
I have put both the R-101.pkl and R-50.pkl files in the pretrained directory and still getting the same error
From where did you get those files?
@aguang1201 I got the same error when loading the model.
Mask-RCNN/maskscoring_rcnn-master/maskrcnn_benchmark/utils/c2_model_loading.py in _load_c2_pickled_weights(file_path) 122 with open(file_path, "rb") as f: 123 if torch._six.PY3: --> 124 data = pickle.load(f, encoding="latin1") 125 else: 126 data = pickle.load(f) UnpicklingError: invalid load key, '<'.
I found this is path problem. The file-path in the code is like './pretrained_model/***'. So you have to put your Jupiter/script file in the same director as pre_train folder.
@aguang1201 I got the same error when loading the model.
Mask-RCNN/maskscoring_rcnn-master/maskrcnn_benchmark/utils/c2_model_loading.py in _load_c2_pickled_weights(file_path) 122 with open(file_path, "rb") as f: 123 if torch._six.PY3: --> 124 data = pickle.load(f, encoding="latin1") 125 else: 126 data = pickle.load(f) UnpicklingError: invalid load key, '<'.
I found this is path problem. The file-path in the code is like './pretrained_model/***'. So you have to put your Jupiter/script file in the same director as pre_train folder.
怎么弄?还是不行
I have solved this problem by adding a line "cfg.set_new_allowed(True)" before "cfg.merge_from_file(args.config_file)" in my .py file.
Traceback (most recent call last): File "tools/train_net.py", line 171, in
main()
File "tools/train_net.py", line 143, in main
cfg.merge_from_file(args.config_file)
File "/usr/local/lib/python3.6/dist-packages/yacs/config.py", line 213, in merge_from_file
self.merge_from_other_cfg(cfg)
File "/usr/local/lib/python3.6/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.6/dist-packages/yacs/config.py", line 460, in _merge_a_into_b
_merge_a_into_b(v, b[k], root, key_list + [k])
File "/usr/local/lib/python3.6/dist-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.PRETRAINED_MODELS'