当前位置:网站首页>AttributeError: Can‘t get attribute ‘SPPF‘ on <module ‘models. common‘ from ‘/home/yolov5/models/comm
AttributeError: Can‘t get attribute ‘SPPF‘ on <module ‘models. common‘ from ‘/home/yolov5/models/comm
2022-07-06 06:47:00 【Zhenhua oppo】
I am here ubuntu The next has been successfully run yolov5 Multiple versions of , There are also environment deployment tutorials . Then because of the need to transform the model , I downloaded it from the non official website warehouse again yolov5 Code , However, the author of the warehouse did not indicate which version was the basis of the magic change . Then I use it normally 6.1 Version of the model , Of course, environment dependency does not need to be installed ,yolov5 The environment is the same , One time installation , Permanent operation .
Error message |
---|
function detect.py file , Then the following error report appears :
Namespace(agnostic_nms=False, augment=False, classes=None, conf_thres=0.25, device='',
exist_ok=False, img_size=416, iou_thres=0.45, name='exp', project='runs/detect',
rknn_mode=False, save_conf=False, save_txt=False, source='rtsp://admin:@192.168.144.64/h264/ch1
/main/av_stream', update=False, view_img=False, weights='./models/yolov5s.pt')
YOLOv5 torch 1.9.0 CPU
Traceback (most recent call last):
File "detect.py", line 258, in <module>
detect()
File "detect.py", line 34, in detect
model = attempt_load(weights, map_location=device) # load FP32 model
File "/home/firefly/yolov5-rknn/models/experimental.py", line 118, in attempt_load
ckpt = torch.load(w, map_location=map_location) # load
File "/home/firefly/anaconda3/envs/yolo/lib/python3.8/site-packages/torch/serialization.py", line 607, in load
return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
File "/home/firefly/anaconda3/envs/yolo/lib/python3.8/site-packages/torch/serialization.py", line 882, in _load
result = unpickler.load()
File "/home/firefly/anaconda3/envs/yolo/lib/python3.8/site-packages/torch/serialization.py", line 875, in find_class
return super().find_class(mod_name, name)
AttributeError: Can't get attribute 'SPPF' on <module 'models.common' from '/home/firefly/rknn/models/common.py'>
Error reporting analysis |
---|
Positioning error , The discovery is in models.common In file , Without this SPPF Method . Online solutions , from 6.1 In the version SPPF Method , Then run and continue to report errors :
File "/home/firefly/yolov5-rknn/models/yolo.py", line 58, in forward
y[..., 2:4] = (y[..., 2:4] * 2) ** 2 * self.anchor_grid[i] # wh
RuntimeError: The size of tensor a (52) must match the size of tensor b (56) at non-singleton dimension 3
The subsequent error reporting will be solved endlessly , And it doesn't apply at all , There are a lot of students eager for solutions under those comment areas .
Then I began to feel for myself , First, consider whether it is a model problem ,model Is loaded weights Of , Is it right? weights Version and yolov5 The version doesn't match . Then I asked she you to help me from github Download it. yolov5 3.0 The weight file of , Replace , Sure enough, the problem was solved successfully .
Error reporting solution |
---|
from yolov5 Warehouse Download the corresponding version of your code yolov5s.pt file , Otherwise, errors will be caused by the mismatch between the weight file version and the source code version . For example, after I download , Put it in models Next ,detect.py final weights The path is also modified :
parser.add_argument('--weights', nargs='+', type=str, default='./models/yolov5s.pt', help='model.pt path(s)')
python detect.py
Rerun :
边栏推荐
- Reflex WMS中阶系列3:显示已发货可换组
- Biomedical English contract translation, characteristics of Vocabulary Translation
- Do you really know the use of idea?
- 中英对照:You can do this. Best of luck祝你好运
- Lecture 8: 1602 LCD (Guo Tianxiang)
- Cobalt Strike特征修改
- 翻译公司证件盖章的价格是多少
- Day 248/300 关于毕业生如何找工作的思考
- E-book CHM online CS
- The internationalization of domestic games is inseparable from professional translation companies
猜你喜欢
生物医学本地化翻译服务
A method to measure the similarity of time series: from Euclidean distance to DTW and its variants
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
Phishing & filename inversion & Office remote template
L'Ia dans les nuages rend la recherche géoscientifique plus facile
What are the characteristics of trademark translation and how to translate it?
ML之shap:基于adult人口普查收入二分类预测数据集(预测年收入是否超过50k)利用Shap值对XGBoost模型实现可解释性案例之详细攻略
AttributeError: Can‘t get attribute ‘SPPF‘ on <module ‘models.common‘ from ‘/home/yolov5/models/comm
How to translate biomedical instructions in English
[brush questions] how can we correctly meet the interview?
随机推荐
[web security] nodejs prototype chain pollution analysis
Fedora/rehl installation semanage
Py06 dictionary mapping dictionary nested key does not exist test key sorting
[ 英語 ] 語法重塑 之 動詞分類 —— 英語兔學習筆記(2)
如何做好金融文献翻译?
[ 英语 ] 语法重塑 之 动词分类 —— 英语兔学习笔记(2)
基于PyTorch和Fast RCNN快速实现目标识别
AttributeError: Can‘t get attribute ‘SPPF‘ on <module ‘models.common‘ from ‘/home/yolov5/models/comm
基于购买行为数据对超市顾客进行市场细分(RFM模型)
Leetcode daily question (971. flip binary tree to match preorder traversal)
MySQL5.72.msi安装失败
[Yu Yue education] flower cultivation reference materials of Weifang Vocational College
Phishing & filename inversion & Office remote template
删除外部表源数据
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
Tms320c665x + Xilinx artix7 DSP + FPGA high speed core board
[English] Grammar remodeling: the core framework of English Learning -- English rabbit learning notes (1)
pymongo获取一列数据
CS certificate fingerprint modification
Leetcode - 152 product maximum subarray