Giter VIP home page Giter VIP logo

Comments (8)

positive666 avatar positive666 commented on May 15, 2024

报错:AttributeError: Can't get attribute 'SPPF' on <module 'models.common' from 'C:\Users\86153\yolov5-mosaic9\models\common.py'>
请提供一个完整的运行命令

from yolo_research.

Xiao-Qi-Guai avatar Xiao-Qi-Guai commented on May 15, 2024

(base) C:\Users\86153>activate yolov5

(yolov5) C:\Users\86153>cd yolov5-mosaic9

(yolov5) C:\Users\86153\yolov5-mosaic9>python train.py --data data/voc.yaml --cfg models/yolov5s.yaml --weights weights/yolov5s.pt --batch-size 4 --epochs 50
C:\Users\86153\anaconda3\envs\yolov5\lib\site-packages\torchvision\io\image.py:11: UserWarning: Failed to load image Python extension: Could not find module 'C:\Users\86153\anaconda3\envs\yolov5\Lib\site-packages\torchvision\image.pyd' (or one of its dependencies). Try using the full path with constructor syntax.
warn(f"Failed to load image Python extension: {e}")
Using torch 1.10.2 CUDA:0 (GeForce MX230, 2048MB)

Namespace(adam=False, batch_size=4, bucket='', cache_images=False, cfg='models/yolov5s.yaml', data='data/voc.yaml', device='', epochs=50, evolve=False, exist_ok=False, global_rank=-1, gr=1.0, hyp='data/hyp.scratch.yaml', image_weights=False, img_size=[640, 640], local_rank=-1, log_artifacts=False, log_imgs=16, multi_scale=False, name='exp', noautoanchor=False, nosave=False, notest=False, project='runs/train', quad=False, rect=False, resume=False, save_dir='runs\train\exp5', single_cls=False, sync_bn=False, total_batch_size=4, weights='weights/yolov5s.pt', workers=8, world_size=1)
Start Tensorboard with "tensorboard --logdir runs/train", view at http://localhost:6006/
Hyperparameters {'lr0': 0.01, 'lrf': 0.2, 'momentum': 0.937, 'weight_decay': 0.0005, 'warmup_epochs': 3.0, 'warmup_momentum': 0.8, 'warmup_bias_lr': 0.1, 'box': 0.05, 'cls': 0.3, 'cls_pw': 1.0, 'obj': 0.5, 'obj_pw': 1.0, 'iou_t': 0.2, 'anchor_t': 4.0, 'fl_gamma': 0.0, 'hsv_h': 0.015, 'hsv_s': 0.7, 'hsv_v': 0.4, 'degrees': 0.0, 'translate': 0.1, 'scale': 0.9, 'shear': 0.0, 'perspective': 0.0, 'flipud': 0.0, 'fliplr': 0.5, 'mosaic': 1.0, 'mixup': 0.01}
Traceback (most recent call last):
File "train.py", line 517, in
train(hyp, opt, device, tb_writer, wandb)
File "train.py", line 83, in train
ckpt = torch.load(weights, map_location=device) # load checkpoint
File "C:\Users\86153\anaconda3\envs\yolov5\lib\site-packages\torch\serialization.py", line 607, in load
return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
File "C:\Users\86153\anaconda3\envs\yolov5\lib\site-packages\torch\serialization.py", line 882, in _load
result = unpickler.load()
File "C:\Users\86153\anaconda3\envs\yolov5\lib\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 'C:\Users\86153\yolov5-mosaic9\models\common.py'>

from yolo_research.

Xiao-Qi-Guai avatar Xiao-Qi-Guai commented on May 15, 2024

from yolo_research.

positive666 avatar positive666 commented on May 15, 2024

最后的错误应该是你的代码模型和 你的权重存在冲突

from yolo_research.

Xiao-Qi-Guai avatar Xiao-Qi-Guai commented on May 15, 2024

from yolo_research.

positive666 avatar positive666 commented on May 15, 2024

   是不是因为我下载的模型是yolov5-3.1,但是权重文件是对应yolov5-6.1?我还有一个问题,就是如果我想在在输入的时候把4拼换成9拼,只需要根据您发的源码,直接替换load_mosaic函数就可以?

估计是你的代码和权重不匹配,我的代码是最新的一般 MOSAIC的话,你直接看作者源码逻辑里如何启动调用就行 这部分逻辑没区别的

from yolo_research.

Xiao-Qi-Guai avatar Xiao-Qi-Guai commented on May 15, 2024

from yolo_research.

github-actions avatar github-actions commented on May 15, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from yolo_research.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.