当前位置:网站首页>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.py
Rediriger:
边栏推荐
猜你喜欢
金融德语翻译,北京专业的翻译公司
How much is the price for the seal of the certificate
University of Manchester | dda3c: collaborative distributed deep reinforcement learning in swarm agent systems
女生学软件测试难不难 入门门槛低,学起来还是比较简单的
A method to measure the similarity of time series: from Euclidean distance to DTW and its variants
商标翻译有什么特点,如何翻译?
Financial German translation, a professional translation company in Beijing
MySQL5.72.msi安装失败
SQL Server manager studio(SSMS)安装教程
Basic commands of MySQL
随机推荐
Lecture 8: 1602 LCD (Guo Tianxiang)
AttributeError: Can‘t get attribute ‘SPPF‘ on <module ‘models.common‘ from ‘/home/yolov5/models/comm
Leetcode - 152 product maximum subarray
Do you really know the use of idea?
国产游戏国际化离不开专业的翻译公司
How to convert flv file to MP4 file? A simple solution
成功解决TypeError: data type ‘category‘ not understood
LeetCode - 152 乘积最大子数组
Defense (greed), FBI tree (binary tree)
论文翻译英译中,怎样做翻译效果好?
In English translation of papers, how to do a good translation?
26岁从财务转行软件测试,4年沉淀我已经是25k的测开工程师...
[Yu Yue education] Dunhuang Literature and art reference materials of Zhejiang Normal University
The registration password of day 239/300 is 8~14 alphanumeric and punctuation, and at least 2 checks are included
【刷题】怎么样才能正确的迎接面试?
Chapter 7 - thread pool of shared model
How to do a good job in financial literature translation?
My creation anniversary
雲上有AI,讓地球科學研究更省力
Office doc add in - Online CS