当前位置:网站首页>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:
边栏推荐
- Today's summer solstice
- Bitcoinwin (BCW): 借贷平台Celsius隐瞒亏损3.5万枚ETH 或资不抵债
- LeetCode每日一题(1870. Minimum Speed to Arrive on Time)
- Cobalt Strike特征修改
- SSO process analysis
- In English translation of papers, how to do a good translation?
- 如何将flv文件转为mp4文件?一个简单的解决办法
- Lesson 7 tensorflow realizes convolutional neural network
- [Yu Yue education] flower cultivation reference materials of Weifang Vocational College
- Brief introduction to the curriculum differences of colleges and universities at different levels of machine human major -ros1/ros2-
猜你喜欢
金融德语翻译,北京专业的翻译公司
Classification des verbes reconstruits grammaticalement - - English Rabbit Learning notes (2)
Tms320c665x + Xilinx artix7 DSP + FPGA high speed core board
Cobalt strike feature modification
Bitcoinwin (BCW): 借贷平台Celsius隐瞒亏损3.5万枚ETH 或资不抵债
AttributeError: Can‘t get attribute ‘SPPF‘ on <module ‘models.common‘ from ‘/home/yolov5/models/comm
Making interactive page of "left tree and right table" based on jeecg-boot
How to convert flv file to MP4 file? A simple solution
Financial German translation, a professional translation company in Beijing
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
随机推荐
Cobalt strike feature modification
Number of query fields
Day 245/300 JS forEach 多层嵌套后数据无法更新到对象中
一文读懂简单查询代价估算
ML之shap:基于adult人口普查收入二分类预测数据集(预测年收入是否超过50k)利用Shap值对XGBoost模型实现可解释性案例之详细攻略
详解SQL中Groupings Sets 语句的功能和底层实现逻辑
LeetCode每日一题(1870. Minimum Speed to Arrive on Time)
L'Ia dans les nuages rend la recherche géoscientifique plus facile
Phishing & filename inversion & Office remote template
Day 245/300 JS foreach data cannot be updated to the object after multi-layer nesting
Biomedical English contract translation, characteristics of Vocabulary Translation
MySQL5.72. MSI installation failed
Machine learning plant leaf recognition
MySQL5.72.msi安装失败
In English translation of papers, how to do a good translation?
[Yu Yue education] flower cultivation reference materials of Weifang Vocational College
Thesis abstract translation, multilingual pure human translation
Suspended else
Day 239/300 注册密码长度为8~14个字母数字以及标点符号至少包含2种校验
Redis Foundation