Inference for Detectron2 PointRend_X101-FPN_model #668
-
I have trained the PointRend_X101-FPN model on Detectron2. But I am getting the following error during inference. I wonder whether the PointRend model is supported or not? Does anybody have any idea what's going on here? Thank you! `/content/drive/MyDrive/Detectron2/PointRend_X101-FPN_model/object_detection/config_original.yaml not available in Model Zoo!RuntimeError Traceback (most recent call last) 8 frames RuntimeError: /content/drive/MyDrive/Detectron2/PointRend_X101-FPN_model/object_detection/config_original.yaml not available in Model Zoo! During handling of the above exception, another exception occurred: KeyError Traceback (most recent call last) /usr/local/lib/python3.7/dist-packages/sahi/model.py in init(self, model_path, config_path, device, mask_threshold, confidence_threshold, category_mapping, category_remapping, load_at_init, image_size) /usr/local/lib/python3.7/dist-packages/sahi/model.py in load_model(self) /usr/local/lib/python3.7/dist-packages/detectron2/config/config.py in merge_from_file(self, cfg_filename, allow_unsafe) /usr/local/lib/python3.7/dist-packages/fvcore/common/config.py in merge_from_other_cfg(self, cfg_other) /usr/local/lib/python3.7/dist-packages/yacs/config.py in merge_from_other_cfg(self, cfg_other) /usr/local/lib/python3.7/dist-packages/yacs/config.py in _merge_a_into_b(a, b, root, key_list) /usr/local/lib/python3.7/dist-packages/yacs/config.py in _merge_a_into_b(a, b, root, key_list) KeyError: 'Non-existent config key: INPUT.COLOR_AUG_SSD'` |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments
-
you can try to get config file directly. don't get from model_zoo |
Beta Was this translation helpful? Give feedback.
-
SAHI supports object detection and instance segmentation models. Detectron2 Object Detection: https://github.com/facebookresearch/detectron2/blob/main/MODEL_ZOO.md#coco-object-detection-baselines Detectron2 Instance Segmentation: https://github.com/facebookresearch/detectron2/blob/main/MODEL_ZOO.md#coco-instance-segmentation-baselines-with-mask-r-cnn |
Beta Was this translation helpful? Give feedback.
-
To test the custom detectron2 model you should follow the steps here. |
Beta Was this translation helpful? Give feedback.
-
@kaphleamrit2 you have to export your detectron2 config as yaml, then use the config path during Detectron2DetectionModel initilialization. Details on how to export Detectron2 config as yaml can be found in this blog post: https://medium.com/geekculture/perform-sliced-inference-and-detailed-error-analysis-using-detectron2-models-8d9c551953f3 |
Beta Was this translation helpful? Give feedback.
-
@fcakyon @kadirnar Thanks for suggestion. Here is my custom cfg:
export my model cfg file as: export_cfg_as_yaml(cfg, export_path='config.yaml')
Then define detection model: `/content/config.yaml not available in Model Zoo!RuntimeError Traceback (most recent call last) 8 frames During handling of the above exception, another exception occurred: KeyError Traceback (most recent call last) KeyError: 'Non-existent config key: INPUT.COLOR_AUG_SSD'` I don't know what is happening. Other model works fine but I can't figure in this model where is the problem. |
Beta Was this translation helpful? Give feedback.
-
Hi @fcakyon This model does not work in the SAHI algorithm. It may be because of the point format.
Error Message:
and
Output (demo_data/prediction_visual.png): |
Beta Was this translation helpful? Give feedback.
-
@kaphleamrit2 @kadirnar what is different in pointrend? |
Beta Was this translation helpful? Give feedback.
-
Hi @kaphleamrit2, Paste this code on line 551.
Then you need to download these files and edit the file path. Detect Code:
|
Beta Was this translation helpful? Give feedback.
Hi @kaphleamrit2,
Paste this code on line 551.
Then you need to download these files and edit the file path.
Detect Code: