-
|
Dear Sahi contributor, recently I train my own yolov5 model and got .pth to do predict. So far, I rename .pth to .pt and use sahi to do sliceing. But it does not work. The error is below. Can you help me to explain what can I do to use Sahi. KeyError Traceback (most recent call last) File ~/miniconda3/lib/python3.8/site-packages/yolov5/helpers.py:34, in load_model(model_path, device, autoshape, verbose) File ~/miniconda3/lib/python3.8/site-packages/yolov5/models/common.py:310, in DetectMultiBackend.init(self, weights, device, dnn, data, fp16) File ~/miniconda3/lib/python3.8/site-packages/yolov5/models/experimental.py:100, in attempt_load(weights, map_location, inplace, fuse) KeyError: 'model' During handling of the above exception, another exception occurred: TypeError Traceback (most recent call last) File ~/miniconda3/lib/python3.8/site-packages/sahi/auto_model.py:63, in AutoDetectionModel.from_pretrained(model_type, model_path, config_path, device, mask_threshold, confidence_threshold, category_mapping, category_remapping, load_at_init, image_size, **kwargs) File ~/miniconda3/lib/python3.8/site-packages/sahi/model.py:77, in DetectionModel.init(self, model_path, model, config_path, device, mask_threshold, confidence_threshold, category_mapping, category_remapping, load_at_init, image_size) File ~/miniconda3/lib/python3.8/site-packages/sahi/model.py:373, in Yolov5DetectionModel.load_model(self) TypeError: ('model_path is not a valid yolov5 model path: ', KeyError('model')) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Do you figure out this problem?l meet the seem one. sometimes, the detection can run correctly in the form of pt. |
Beta Was this translation helpful? Give feedback.
Yes, I figure it. I use a new pth and write the custormrize model with sahi myself.