当前位置:网站首页>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:46:00 【Zhenhua oppo】
Je suisubuntuLe prochain a fonctionné avec succèsyolov5Plusieurs versions de,Un tutoriel sur le déploiement de l'environnement est également sorti.Et parce que le besoin de transformer le modèle,Je l'ai téléchargé dans l'entrepôtyolov5Code,Mais l'auteur de l'entrepôt n'a pas indiqué sur quelle base la modification magique a été effectuée.Et je l'utilise normalement6.1Version du modèle,Bien sûr, les dépendances environnementales n'ont pas besoin d'être installées,yolov5Les circonstances sont les mêmes.,Installation primaire,Fonctionnement permanent.
| Message d'erreur |
|---|
Exécutiondetect.pyDocumentation,Puis l'erreur suivante apparaît:
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'>
| Analyse des erreurs |
|---|
Erreur de positionnement,La découverte a été faitemodels.commonDans le document,Pas ça.SPPFMéthodes. Solutions en ligne ,De6.1Dans la versionSPPF Méthode copiée ici , Puis l'exécution continue à signaler des erreurs :
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
Les erreurs suivantes seront résolues sans fin , Et ça ne s'applique pas du tout , Il y a beaucoup d'étudiants qui sont pressés de trouver une solution sous la section commentaires .
Alors j'ai commencé à tâter moi - même , Considérez d'abord si c'est un problème de modèle ,model Est chargé weightsDe,C'est ça?weightsVersion etyolov5 Les versions ne correspondent pas . Puis j'ai demandé à she de m'aider à githubTéléchargéyolov5 3.0Fichier de poids pour,Remplacer, J'ai réussi à résoudre le problème .
| Résolution des erreurs |
|---|
Deyolov5Entrepôt Téléchargez la version de votre code correspondant à yolov5s.ptDocumentation, Sinon, une erreur peut se produire parce que la version du fichier de poids et la version du code source ne correspondent pas . Comme quand j'ai téléchargé ,C'est parti.modelsEn bas.,detect.pyLe dernier.weights Le chemin est également modifié :
parser.add_argument('--weights', nargs='+', type=str, default='./models/yolov5s.pt', help='model.pt path(s)')
python detect.pyRediriger:

边栏推荐
- SQL Server Manager studio (SSMS) installation tutorial
- Biomedical localization translation services
- P5706 [deep foundation 2. Example 8] redistributing fat house water -- February 13, 2022
- AI on the cloud makes earth science research easier
- 翻译生物医学说明书,英译中怎样效果佳
- Day 248/300 关于毕业生如何找工作的思考
- 详解SQL中Groupings Sets 语句的功能和底层实现逻辑
- 金融德语翻译,北京专业的翻译公司
- Day 246/300 SSH connection prompt "remote host identification has changed!"
- 云服务器 AccessKey 密钥泄露利用
猜你喜欢

Reflex WMS中阶系列3:显示已发货可换组

详解SQL中Groupings Sets 语句的功能和底层实现逻辑

Advanced MySQL: Basics (1-4 Lectures)

Use shortcut LNK online CS

云上有AI,让地球科学研究更省力

Cobalt strike feature modification

云服务器 AccessKey 密钥泄露利用

What is the difference between int (1) and int (10)? Senior developers can't tell!

Suspended else

今日夏至 Today‘s summer solstice
随机推荐
Summary of leetcode's dynamic programming 4
Day 246/300 ssh连接提示“REMOTE HOST IDENTIFICATION HAS CHANGED! ”
A 27-year-old without a diploma, wants to work hard on self-study programming, and has the opportunity to become a programmer?
[English] Verb Classification of grammatical reconstruction -- English rabbit learning notes (2)
国际经贸合同翻译 中译英怎样效果好
【刷题】怎么样才能正确的迎接面试?
删除外部表源数据
How effective is the Chinese-English translation of international economic and trade contracts
电子书-CHM-上线CS
Phishing & filename inversion & Office remote template
(practice C language every day) reverse linked list II
Making interactive page of "left tree and right table" based on jeecg-boot
Map of mL: Based on the adult census income two classification prediction data set (whether the predicted annual income exceeds 50K), use the map value to realize the interpretable case of xgboost mod
Bitcoinwin (BCW): 借贷平台Celsius隐瞒亏损3.5万枚ETH 或资不抵债
Day 239/300 注册密码长度为8~14个字母数字以及标点符号至少包含2种校验
商标翻译有什么特点,如何翻译?
如何做好金融文献翻译?
如何做好互联网金融的英语翻译
ROS2安装及基础知识介绍
基于购买行为数据对超市顾客进行市场细分(RFM模型)