Skip to content

onnxruntime-gpu 1.10Β #5916

Closed
Closed

Description

@guishilike

Search before asking

  • I have searched the YOLOv5 issues and found no similar feature requests.

Description

Using onnxruntime-gpu 1.10, the following error will occur.

raise ValueError("This ORT build has {} enabled. ".format(available_providers) +
ValueError: This ORT build has ['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider'] enabled. Since ORT 1.9, you are required to explicitly set the providers parameter when instantiating InferenceSession. For example, onnxruntime.InferenceSession(..., providers=['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider'], ...)

Use case

onnxruntime-gpu 1.10 requires providers

elif onnx:  # ONNX Runtime
    LOGGER.info(f'Loading {w} for ONNX Runtime inference...')
    check_requirements(('onnx', 'onnxruntime-gpu' if torch.cuda.is_available() else 'onnxruntime'))
    import onnxruntime
    if torch.cuda.is_available():
         session = onnxruntime.InferenceSession(w, None, providers=["CUDAExecutionProvider"])
    else:
          session = onnxruntime.InferenceSession(w, None)

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Activity

  1. github-actions commented on Dec 8, 2021

    @github-actions
    Contributor

    πŸ‘‹ Hello @guishilike, 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://ultralytics.com or email Glenn Jocher at glenn.jocher@ultralytics.com.

    Requirements

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

    $ git clone https://github.com/ultralytics/yolov5
    $ cd yolov5
    $ 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), validation (val.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit.

  2. glenn-jocher commented on Dec 8, 2021

    @glenn-jocher
    Member

    @guishilike thanks for the bug report! I'm able to reproduce. I will work on a fix for this.

  3. added a commit that references this issue on Dec 8, 2021
  4. linked a pull request that will close this issueAdd ONNX inference providers #5918on Dec 8, 2021
  5. added a commit that references this issue on Dec 8, 2021
  6. glenn-jocher commented on Dec 8, 2021

    @glenn-jocher
    Member

    @guishilike good news πŸ˜ƒ! Your original issue may now be fixed βœ… in PR #5918. To receive this update:

    • Git – git pull from within your yolov5/ directory or git clone https://github.com/ultralytics/yolov5 again
    • PyTorch Hub – Force-reload model = torch.hub.load('ultralytics/yolov5', 'yolov5s', force_reload=True)
    • Notebooks – View updated notebooks Open In Colab Open In Kaggle
    • Docker – sudo docker pull ultralytics/yolov5:latest to update your image Docker Pulls

    Thank you for spotting this issue and informing us of the problem. Please let us know if this update resolves the issue for you, and feel free to inform us of any other issues you discover or feature requests that come to mind. Happy trainings with YOLOv5 πŸš€!

  7. somuchtolearn007 commented on Nov 10, 2022

    @somuchtolearn007

    @guishilike good news πŸ˜ƒ! Your original issue may now be fixed βœ… in PR #5918. To receive this update:

    * **[Git](https://github.com/ultralytics/yolov5)** – `git pull` from within your `yolov5/` directory or `git clone https://github.com/ultralytics/yolov5` again
    
    * **[PyTorch Hub](https://pytorch.org/hub/ultralytics_yolov5/)** – Force-reload `model = torch.hub.load('ultralytics/yolov5', 'yolov5s', force_reload=True)`
    
    * **[Notebooks](https://github.com/ultralytics/yolov5/blob/master/tutorial.ipynb)** – View updated notebooks  [![Open In Colab](https://camo.githubusercontent.com/84f0493939e0c4de4e6dbe113251b4bfb5353e57134ffd9fcab6b8714514d4d1/68747470733a2f2f636f6c61622e72657365617263682e676f6f676c652e636f6d2f6173736574732f636f6c61622d62616467652e737667)](https://colab.research.google.com/github/ultralytics/yolov5/blob/master/tutorial.ipynb) [![Open In Kaggle](https://camo.githubusercontent.com/a08ca511178e691ace596a95d334f73cf4ce06e83a5c4a5169b8bb68cac27bef/68747470733a2f2f6b6167676c652e636f6d2f7374617469632f696d616765732f6f70656e2d696e2d6b6167676c652e737667)](https://www.kaggle.com/models/ultralytics/yolov5)
    
    * **[Docker](https://hub.docker.com/r/ultralytics/yolov5)** – `sudo docker pull ultralytics/yolov5:latest` to update your image [![Docker Pulls](https://camo.githubusercontent.com/280faedaf431e4c0c24fdb30ec00a66d627404e5c4c498210d3f014dd58c2c7e/68747470733a2f2f696d672e736869656c64732e696f2f646f636b65722f70756c6c732f756c7472616c79746963732f796f6c6f76353f6c6f676f3d646f636b6572)](https://hub.docker.com/r/ultralytics/yolov5)
    

    Thank you for spotting this issue and informing us of the problem. Please let us know if this update resolves the issue for you, and feel free to inform us of any other issues you discover or feature requests that come to mind. Happy trainings with YOLOv5 πŸš€!

    I am facing the same issue
    This ORT build has ['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider'] enabled. Since ORT 1.9, you are required to explicitly set the providers parameter when instantiating InferenceSession. For example, onnxruntime.InferenceSession(..., providers=['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider'], ...)
    while I am trying to run SimSwap. How to fix it?

  8. glenn-jocher commented on Nov 15, 2022

    @glenn-jocher
    Member

    @somuchtolearn007 πŸ‘‹ hi, thanks for letting us know about this possible problem with YOLOv5 πŸš€. We've created a few short guidelines below to help users provide what we need in order to start investigating a possible problem.

    How to create a Minimal, Reproducible Example

    When asking a question, people will be better able to provide help if you provide code that they can easily understand and use to reproduce the problem. This is referred to by community members as creating a minimum reproducible example. Your code that reproduces the problem should be:

    • βœ… Minimal – Use as little code as possible to produce the problem
    • βœ… Complete – Provide all parts someone else needs to reproduce the problem
    • βœ… Reproducible – Test the code you're about to provide to make sure it reproduces the problem

    For Ultralytics to provide assistance your code should also be:

    • βœ… Current – Verify that your code is up-to-date with GitHub master, and if necessary git pull or git clone a new copy to ensure your problem has not already been solved in master.
    • βœ… Unmodified – Your problem must be reproducible using official YOLOv5 code without changes. Ultralytics does not provide support for custom code ⚠️.

    If you believe your problem meets all the above criteria, please close this issue and raise a new one using the πŸ› Bug Report template with a minimum reproducible example to help us better understand and diagnose your problem.

    Thank you! πŸ˜ƒ

  9. Muffinxz commented on Oct 24, 2023

    @Muffinxz

    I still have the same issue even after running
    model = torch.hub.load('ultralytics/yolov5', 'yolov5s', force_reload=True)
    @glenn-jocher
    Any help please ?

  10. glenn-jocher commented on Oct 24, 2023

    @glenn-jocher
    Member

    Hi @Muffinxz,

    I apologize for the continued issue you're experiencing. To further investigate this problem, could you please provide us with a minimal reproducible example? This will help us better understand the problem and provide the most appropriate solution.

    Additionally, could you provide the following information:

    • The version of YOLOv5 you are using
    • The version of PyTorch you are using
    • The exact error message or stack trace you are receiving

    With this information, we'll be in a better position to assist you. Thank you!

  11. Muffinxz commented on Oct 24, 2023

    @Muffinxz

    @glenn-jocher
    Sure the version of yolov5 i am using is 7.0.2
    the version of pytorch 2.0.1+cu118
    The ERROR : ValueError: This ORT build has ['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider'] enabled. Since ORT 1.9, you are required to explicitly set the providers parameter when instantiating InferenceSession. For example, onnxruntime.InferenceSession(..., providers=['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider'], ...)

  12. glenn-jocher commented on Oct 24, 2023

    @glenn-jocher
    Member

    @Muffinxz

    Thank you for providing the additional information.

    The error message you are encountering, "ValueError: This ORT build has ['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider'] enabled..." suggests that there is an issue with the Open Neural Network Exchange (ONNX) Runtime (ORT) build being used.

    Since ORT 1.9, it is now required to explicitly set the providers parameter when instantiating InferenceSession. You can include the desired providers as a list in the providers parameter, for example:

    onnxruntime.InferenceSession(..., providers=['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider'], ...)

    To resolve this issue, you may need to update your ORT installation or check if there are any known compatibility issues between YOLOv5 v7.0.2, PyTorch 1.9, and the version of ORT you have installed.

    Please let us know if updating ORT or checking for compatibility issues resolves the problem for you. If you have any further questions or issues, please don't hesitate to ask.

  13. added a commit that references this issue on Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions