RuningMangoPi / yolov8_QAT

12 stars 1 forks source link

想问一下这个错误 #4

Open StarryAzure opened 1 month ago

StarryAzure commented 1 month ago

Rules: model.2.m.0.cv1.conv match to model.2.cv2.conv Rules: /model.2/m match to model.2.cv2.conv Traceback (most recent call last): File "F:\Desktop\量化\yolov8_QAT-master\qat-yolov8.py", line 339, in run_qat( File "F:\Desktop\量化\yolov8_QAT-master\qat-yolov8.py", line 105, in run_qat quantize.apply_custom_rules_to_quantizer(model, export_onnx) File "F:\Desktop\量化\yolov8_QAT-master\quantize.py", line 215, in apply_custom_rules_to_quantizer get_attr_with_path(model, sub)._input_quantizer = get_attr_with_path(model, major)._input_quantizer File "F:\Desktop\量化\yolov8_QAT-master\quantize.py", line 205, in get_attr_with_path return sub_attr(m, path.split(".")) File "F:\Desktop\量化\yolov8_QAT-master\quantize.py", line 199, in sub_attr value = getattr(m, name) File "G:\anaconda3\envs\yolov8\lib\site-packages\torch\nn\modules\module.py", line 1695, in getattr raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'") AttributeError: 'DetectionModel' object has no attribute '/model'

进程已结束,退出代码1

这个错误该如何修改,确实没有头绪

olibartfast commented 1 month ago

Hi @StarryAzure , What Ultralytics release or branch are you using (I assume the one cloned 7 months ago in this repo) and what version of Pytorch?

StarryAzure commented 1 month ago

Hi @StarryAzure , What Ultralytics release or branch are you using (I assume the one cloned 7 months ago in this repo) and what version of Pytorch?

i‘m using the lastest version, but i try to make conv2d from fp32 to int8.

olibartfast commented 1 month ago

ok maybe i found a solution, you need strip away the /, i wrote it on the branch I forked, I was really testing a yolov10 model but the problem looks the same https://github.com/olibartfast/yolov10_QAT/commit/73729cee558432c29210d4b12bf2faef322990b3