Skip to content
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

yolov5x.pt is not compatible with ./models/yolov5x.yam #1721

Closed
minertom opened this issue Dec 17, 2020 · 7 comments
Closed

yolov5x.pt is not compatible with ./models/yolov5x.yam #1721

minertom opened this issue Dec 17, 2020 · 7 comments
Labels

Comments

@minertom
Copy link

I have seen this question asked before and I have read the responses.

My interpretation of the responses is that there is the possibility that some older yolov5x.yaml files could have been loaded and that they need to be purged.

I have downloaded the jupyter notebook to two different directories and have attempted to run on google colab. In both cases, i have received the same error.

I believe that this is the command which causes the error.
!python train.py --img 640 --batch 4 --epochs 30 \ --data ./data/clothing.yaml --cfg ./models/yolov5x.yaml --weights yolov5x.pt \ --name yolov5x_clothing --cache

This is the full error

`Traceback (most recent call last):
File "train.py", line 116, in train
ckpt['model'] = {k: v for k, v in ckpt['model'].float().state_dict().items()
File "train.py", line 117, in
if model.state_dict()[k].shape == v.shape} # to FP32, filter
KeyError: 'model.18.conv.weight'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "train.py", line 404, in
train(hyp)
File "train.py", line 122, in train
raise KeyError(s) from e
KeyError: "yolov5x.pt is not compatible with ./models/yolov5x.yaml. Specify --weights '' or specify a --cfg compatible with yolov5x.pt."`

How best to proceed?
Thank You
Tom

@minertom minertom added the bug Something isn't working label Dec 17, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Dec 17, 2020

Hello @minertom, 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.

Requirements

Python 3.8 or later with all requirements.txt dependencies installed, including torch>=1.7. To install run:

$ pip install -r requirements.txt

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

CI CPU testing

If 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.

@glenn-jocher
Copy link
Member

@minertom your code or your models, or both are out of date. Use latest and train normally.

@glenn-jocher glenn-jocher removed the bug Something isn't working label Dec 17, 2020
@minertom
Copy link
Author

minertom commented Dec 17, 2020 via email

@glenn-jocher
Copy link
Member

@minertom if they are not out of date then they may be modified. If you are running into an error with current master please provide a link to a Colab notebook so we can reproduce ourselves. Thanks!

@minertom
Copy link
Author

minertom commented Dec 17, 2020 via email

@glenn-jocher
Copy link
Member

glenn-jocher commented Dec 17, 2020

@minertom your link is a 3rd party notebook, out of our control. If you are having issues with it you should raise these directly with the authors of that notebook.

The official notebook is here, authored by Ultralytics, and everything works correctly.
https://colab.research.google.com/github/ultralytics/yolov5/blob/master/tutorial.ipynb

@github-actions
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants