当前位置:网站首页>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:

边栏推荐
- Automated test environment configuration
- How to convert flv file to MP4 file? A simple solution
- How to translate biomedical instructions in English
- My seven years with NLP
- 【软件测试进阶第1步】自动化测试基础知识
- 翻译公司证件盖章的价格是多少
- Cobalt strike feature modification
- How much is it to translate Chinese into English for one minute?
- Address bar parameter transmission of list page based on jeecg-boot
- How to translate professional papers and write English abstracts better
猜你喜欢
![[web security] nodejs prototype chain pollution analysis](/img/b6/8eddc9cbe343f2439da92bf342b0dc.jpg)
[web security] nodejs prototype chain pollution analysis

Is it difficult for girls to learn software testing? The threshold for entry is low, and learning is relatively simple

Advanced MySQL: Basics (1-4 Lectures)

Changes in the number of words in English papers translated into Chinese

Thesis abstract translation, multilingual pure human translation

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

Making interactive page of "left tree and right table" based on jeecg-boot

How do programmers remember code and programming language?

CS通过(CDN+证书)powershell上线详细版

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
随机推荐
[web security] nodejs prototype chain pollution analysis
How much is the price for the seal of the certificate
Classification des verbes reconstruits grammaticalement - - English Rabbit Learning notes (2)
基於JEECG-BOOT的list頁面的地址欄參數傳遞
Chinese English comparison: you can do this Best of luck
The registration password of day 239/300 is 8~14 alphanumeric and punctuation, and at least 2 checks are included
Erreur de type résolue avec succès: type de données « catégorie» non sous - jacente
生物医学英文合同翻译,关于词汇翻译的特点
Day 246/300 SSH connection prompt "remote host identification has changed!"
Machine learning plant leaf recognition
In English translation of papers, how to do a good translation?
[brush questions] how can we correctly meet the interview?
[English] Verb Classification of grammatical reconstruction -- English rabbit learning notes (2)
查询字段个数
My daily learning records / learning methods
Thesis abstract translation, multilingual pure human translation
Simple query cost estimation
删除外部表源数据
How to translate biomedical instructions in English
L'Ia dans les nuages rend la recherche géoscientifique plus facile