-
-
Notifications
You must be signed in to change notification settings - Fork 16.9k
Can't get attribute 'C3' on <module 'models.common' while loading yolov5s #1855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
👋 Hello @kaushalchapaneri-intellica, thank you for your interest in 🚀 YOLOv5! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution. If this is a 🐛 Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you. If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available. For business inquiries or professional support requests please visit https://www.ultralytics.com or email Glenn Jocher at glenn.jocher@ultralytics.com. RequirementsPython 3.8 or later with all requirements.txt dependencies installed, including $ pip install -r requirements.txt EnvironmentsYOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
StatusIf this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), testing (test.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit. |
@kaushalchapaneri-intellica your code is likely out of date. You should |
hi, while I want to train yolov5 on custom dataset I got this error: Traceback (most recent call last): it happens when I use lastest yolov5x.yaml file which containes: [from, number, module, args][[-1, 1, Focus, [64, 3]], # 0-P1/2 I don't know how to solve it, I will be appreciated if you help me. |
@Lnazvkl your code is out of date. Use |
I had updated, but I have got this error after update. |
@Lnazvkl the error you are seeing is due to out of date or modified code. To start simply clone a fresh copy of the repo, and verify training for a few epochs. git clone https://github.com/ultralytics/yolov5
cd yolov5
python train.py --epochs 3 Alternatively you can start from the official notebook (3rd party notebooks are not supported): |
@Lnazvkl I will also post our full response with additional details that may help you. Please note that most technical problems are due to:
$ git clone https://github.com/ultralytics/yolov5 yolov5_new # clone latest
$ cd yolov5_new
$ python detect.py # verify detection
# CODE TO REPRODUCE YOUR ISSUE HERE
If none of these apply to you, we suggest you close this issue and raise a new one using the 🐛 Bug Report template, providing screenshots and minimum viable code to reproduce your issue. Thank you! RequirementsPython 3.8 or later with all requirements.txt dependencies installed, including $ pip install -r requirements.txt EnvironmentsYOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
StatusIf this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are passing. These tests evaluate proper operation of basic YOLOv5 functionality, including training (train.py), testing (test.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu. |
as you said I update yolov5 but I got these errors: special thanks for your attention. |
@Lnazvkl I don't recognize the notebook you are using. There are many 3rd party notebooks that we do not support and that may have performance issues. I would recommend you simply start from the official YOLOv5 notebook, which is authored by Ultralytics and verified working correctly: To train with the official notebook, you simply click the Setup cell, and then run the Train cell. Two clicks gets you training correctly. |
I am using google colab. |
@Lnazvkl you are using an unsupported notebook in google colab. The official Ultralytics YOLOv5 notebook is here: |
thanks for your response. |
@kaushalchapaneri-intellica |
@cs-heibao try this: step 1 : re clone repo in different folder by now on python terminal or in .py file run this:
|
❔Question
I am trying to load small model of yolo v5 with following steps:
import torch
torch.load('yolov5s.pt')
but getting error AttributeError: Can't get attribute 'C3' on <module 'models.common' from '/yolov5/models/common.py'>
Additional context
i am using ubuntu 18.04
torch == 1.7.1
python = 3.8.0
please let me know if additional information is needed.
The text was updated successfully, but these errors were encountered: