augmentedstartups / AS-One

Easy & Modular Computer Vision Detectors, Trackers & SAM - Run YOLOv9,v8,v7,v6,v5,R,X in under 10 lines of code.
https://www.augmentedstartups.com
GNU General Public License v3.0
603 stars 102 forks source link

Non compatible with Yolov5 6.2 trained models #6

Open zhora-im opened 1 year ago

zhora-im commented 1 year ago

Traceback (most recent call last): File "main.py", line 40, in main(args) File "main.py", line 6, in main dt_obj = ASOne( File "/home/zhora/workspace/AS-One/asone/asone.py", line 20, in init self.detector = self.get_detector(detector) File "/home/zhora/workspace/AS-One/asone/asone.py", line 25, in get_detector detector = Detector(detector, use_cuda=self.use_cuda).get_detector() File "/home/zhora/workspace/AS-One/asone/detectors/detector.py", line 17, in init self.model = self._select_detector(model_flag, use_cuda) File "/home/zhora/workspace/AS-One/asone/detectors/detector.py", line 25, in _select_detector _detector = YOLOv5Detector(weights=weight, File "/home/zhora/workspace/AS-One/asone/detectors/yolov5/yolov5_detector.py", line 26, in init self.model = self.load_model(use_cuda, weights) File "/home/zhora/workspace/AS-One/asone/detectors/yolov5/yolov5_detector.py", line 40, in load_model model = attempt_load(weights, device=self.device, inplace=True, fuse=True) File "/home/zhora/workspace/AS-One/asone/detectors/yolov5/yolov5/models/experimental.py", line 33, in attempt_load ckpt = torch.load(w, map_location='cpu') # load File "/home/zhora/workspace/venv/lib/python3.8/site-packages/torch/serialization.py", line 712, in load return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args) File "/home/zhora/workspace/venv/lib/python3.8/site-packages/torch/serialization.py", line 1049, in _load result = unpickler.load() File "/home/zhora/workspace/venv/lib/python3.8/site-packages/torch/serialization.py", line 1042, in find_class return super().find_class(mod_name, name) AttributeError: Can't get attribute 'DetectionModel' on <module 'models.yolo' from '/home/zhora/workspace/AS-One/asone/detectors/yolov5/yolov5/models/yolo.py'>

MNMaqsood commented 1 year ago

Let us test this and then we can merge it.