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

Acceptable suffix #11858

Closed
1 of 2 tasks
ammar3010 opened this issue Jul 14, 2023 · 4 comments
Closed
1 of 2 tasks

Acceptable suffix #11858

ammar3010 opened this issue Jul 14, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@ammar3010
Copy link

Search before asking

  • I have searched the YOLOv5 issues and found no similar bug report.

YOLOv5 Component

No response

Bug

detect.py was running fine when i cloned the repo but i had to make some changes in the code (only detect.py) to match with my case but it is giving this error:

Traceback (most recent call last):
  File "/home/aidev/VectraCom/threat_detection/threat_detection.py", line 7, in <module>
    image,results = main(img=img)
  File "/home/aidev/VectraCom/threat_detection/yolov5/detect.py", line 164, in main
    image,results = run(img)
  File "/home/aidev/anaconda3/envs/t_detect/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/home/aidev/VectraCom/threat_detection/yolov5/detect.py", line 74, in run
    model = DetectMultiBackend(weights, device=device, dnn=dnn, data=data, fp16=half)
  File "/home/aidev/VectraCom/threat_detection/yolov5/models/common.py", line 335, in __init__
    pt, jit, onnx, xml, engine, coreml, saved_model, pb, tflite, edgetpu, tfjs, paddle, triton = self._model_type(w)
  File "/home/aidev/VectraCom/threat_detection/yolov5/models/common.py", line 607, in _model_type
    check_suffix(p, sf)  # checks
  File "/home/aidev/VectraCom/threat_detection/yolov5/utils/general.py", line 427, in check_suffix
    assert s in suffix, f'{msg}{f} acceptable suffix is {suffix}'

I only changed the way image is inferenced. I passed the image from another file to detect.py after that it stopped working

Environment

  • YOLO: YOLOv5 🚀 2023-7-13 Python-3.10.12 torch-2.0.1+cu117 CUDA:0 (NVIDIA GeForce 940MX, 4044MiB)
  • OS: Ubuntu 22.04
  • Pyhon: 3.10.4 (conda)

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@ammar3010 ammar3010 added the bug Something isn't working label Jul 14, 2023
@github-actions
Copy link
Contributor

👋 Hello @ammar3010, 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 a minimum reproducible example to help us debug it.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results.

Requirements

Python>=3.7.0 with all requirements.txt installed including PyTorch>=1.7. To get started:

git clone https://github.com/ultralytics/yolov5  # clone
cd yolov5
pip install -r requirements.txt  # install

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

YOLOv5 CI

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training, validation, inference, export and benchmarks on macOS, Windows, and Ubuntu every 24 hours and on every commit.

Introducing YOLOv8 🚀

We're excited to announce the launch of our latest state-of-the-art (SOTA) object detection model for 2023 - YOLOv8 🚀!

Designed to be fast, accurate, and easy to use, YOLOv8 is an ideal choice for a wide range of object detection, image segmentation and image classification tasks. With YOLOv8, you'll be able to quickly and accurately detect objects in real-time, streamline your workflows, and achieve new levels of accuracy in your projects.

Check out our YOLOv8 Docs for details and get started with:

pip install ultralytics

@glenn-jocher
Copy link
Member

Hello @ammar3010,

Based on the error you provided, it seems there is an issue with the acceptable suffix for the model weights in your code. The error message indicates that the suffix of the model weights you are using is not compatible.

To resolve this issue, please double-check the suffix of the model weights you are using and ensure that it matches the acceptable suffix specified by YOLOv5. You can find the acceptable suffix in the check_suffix function in the yolov5/utils/general.py file. Make sure the suffix of your model weights matches one of the accepted suffixes.

If you have made changes to the code in detect.py, please review the changes you made and ensure they are not causing any conflicts with the model loading and inference process. Pay special attention to any modifications related to the weights suffix or the model loading code.

If you are still facing issues after following these steps, please provide more details about the changes you made to the code and any relevant code snippets. This will help us better understand the problem and provide you with further assistance.

Let us know if you have any further questions or need more help!

@ammar3010
Copy link
Author

Thanks. And yes i made some changes to model while making other changes by mistake. It's working now.

@glenn-jocher
Copy link
Member

@ammar3010 great to hear that you were able to resolve the issue you were facing! Mistakes happen, and it's all part of the learning process. If you have any further questions or need any assistance in the future, don't hesitate to ask. The YOLOv5 community and the Ultralytics team are always here to help.

Happy coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants