Open ahxiaofengzheng opened 1 year ago
You've chosen to report an unexpected problem or bug. Unless you already know the root cause of it, please include details about it by filling the issue template. The following information is missing: "Instructions To Reproduce the Issue and Full Logs";
Full logs or other relevant observations:
[11/04 17:15:33 detectron2]: Arguments: Namespace(confidence_threshold=0.5, config_file='./output_L_lr_1e-4/config.yaml', input=['./Data/UTDAC2020_enhance/val2017/'], opts=['MODEL.WEIGHTS', './output_L_lr_1e-4/model_final.pth'], output='./UTDAC2020_enhance', video_input=None, webcam=False) WARNING [11/04 17:15:33 fvcore.common.config]: Loading config ./output_L_lr_1e-4/config.yaml with yaml.unsafe_load. Your machine may be at risk if the file contains malicious content. Traceback (most recent call last): File "./demo/demo.py", line 100, in <module> cfg = setup_cfg(args) File "./demo/demo.py", line 29, in setup_cfg cfg.merge_from_file(args.config_file) File "/public/home/wangzheng/detectron2/detectron2/config/config.py", line 47, in merge_from_file loaded_cfg = type(self)(loaded_cfg) File "/public/home/wangzheng/.conda/envs/detectron2/lib/python3.8/site-packages/yacs/config.py", line 86, in __init__ init_dict = self._create_config_tree_from_dict(init_dict, key_list) File "/public/home/wangzheng/.conda/envs/detectron2/lib/python3.8/site-packages/yacs/config.py", line 126, in _create_config_tree_from_dict dic[k] = cls(v, key_list=key_list + [k]) File "/public/home/wangzheng/.conda/envs/detectron2/lib/python3.8/site-packages/yacs/config.py", line 86, in __init__ init_dict = self._create_config_tree_from_dict(init_dict, key_list) File "/public/home/wangzheng/.conda/envs/detectron2/lib/python3.8/site-packages/yacs/config.py", line 126, in _create_config_tree_from_dict dic[k] = cls(v, key_list=key_list + [k]) File "/public/home/wangzheng/.conda/envs/detectron2/lib/python3.8/site-packages/yacs/config.py", line 86, in __init__ init_dict = self._create_config_tree_from_dict(init_dict, key_list) File "/public/home/wangzheng/.conda/envs/detectron2/lib/python3.8/site-packages/yacs/config.py", line 126, in _create_config_tree_from_dict dic[k] = cls(v, key_list=key_list + [k]) File "/public/home/wangzheng/.conda/envs/detectron2/lib/python3.8/site-packages/yacs/config.py", line 86, in __init__ init_dict = self._create_config_tree_from_dict(init_dict, key_list) File "/public/home/wangzheng/.conda/envs/detectron2/lib/python3.8/site-packages/yacs/config.py", line 129, in _create_config_tree_from_dict _assert_with_logging( File "/public/home/wangzheng/.conda/envs/detectron2/lib/python3.8/site-packages/yacs/config.py", line 545, in _assert_with_logging assert cond, msg AssertionError: Key model.backbone.net.norm_layer with value <class 'functools.partial'> is not a valid type; valid types: {<class 'float'>, <class 'list'>, <class 'str'>, <class 'bool'>, <class 'NoneType'>, <class 'tuple'>, <class 'int'>}
Hey,I have the same question,how did you sovle it?
Hey,I have the same question,how did you sovle it?
please help us we need to perform inference on images
Anyone find the answer?
I'm getting the same error AssertionError: Key model.backbone.net.norm_layer with value <class 'functools.partial'> is not a valid type
嘿,我也有同样的问题,你是怎么解决的?
Traceback (most recent call last):
File "demo/demo.py", line 100, in
I also trained with lazyconfig_train_net.py to get my model_final.pth. But I don't know how to use this to predict an image and display bbox and segment. I am not sure if it is because the configuration file is in py format instead of yaml format. Loading the configuration file using "cfg = LazyConfig.load(config_path)" seems to be problematic.
For example, I can use the following script to make predictions about the test picture:
cfg = get_cfg()
cfg.merge_from_file(model_zoo.get_config_file("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml"))
cfg.MODEL.ROI_HEADS.SCORE_THRESH_TEST = 0.5
cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url("COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml")
predictor = DefaultPredictor(cfg)
outputs = predictor(image)
visualizer = Visualizer(image[:, :, ::-1], MetadataCatalog.get(cfg.DATASETS.TRAIN[0]), scale=1.2)
out = visualizer.draw_instance_predictions(outputs["instances"].to("cpu"))
cv2.imshow("Detection Results", out.get_image()[:, :, ::-1])
However, I don't know how to load the configuration file with LazyConfig to achieve the same functionality
I used cascade_mask_rcnn_vitdet_l_100ep.py to train a custom dataset, which can be trained and verified normally, but I can't reason, I didn't find the corresponding yaml configuration file, I only have the config.yaml file saved during training.
When I use DefaultPredictor, I don't have
Model.WEIGHTS,INPUT.MIN_SIZE_TEST,DATASETS
in my config.yaml,How should I use the trained ViTDet model for inference, or where is the corresponding configuration file for ViTDet for inference.The commands I use when training are as follows:
The yaml file obtained in training is as follows:
python ./tools/lazyconfig_train_net_VitDet.py --config-file=./projects/ViTDet/configs/COCO/cascade_mask_rcnn_vitdet_l_100ep.py
The command I use when verifying is as follows:python ./tools/lazyconfig_train_net_VitDet.py --config-file=./projects/ViTDet/configs/COCO/cascade_mask_rcnn_vitdet_l_100ep.py --eval-only train.init_checkpoint=./output_L_lr_1e-4/model_final.pth
My environments is as follows: