`ultralytics 8.0.230` TensorRT export hang fix (#7180)

Co-authored-by: 曾逸夫(Zeng Yifu) <41098760+Zengyf-CVer@users.noreply.github.com>
Co-authored-by: CV & LLM & AIGC er <wenvoi@163.com>
Co-authored-by: Aaron <42322215+aaronllowe@users.noreply.github.com>
Co-authored-by: crypthusiast0 <42322215+crypthusiast0@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
pull/7182/head v8.0.230
Glenn Jocher 11 months ago committed by GitHub
parent bc5b528ca7
commit 8d2a32db77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      .pre-commit-config.yaml
  2. 4
      docs/en/guides/heatmaps.md
  3. 4
      docs/en/integrations/roboflow.md
  4. 2
      setup.py
  5. 2
      ultralytics/__init__.py
  6. 4
      ultralytics/engine/exporter.py

@ -76,6 +76,12 @@ repos:
hooks: hooks:
- id: docformatter - id: docformatter
- repo: https://github.com/hadialqattan/pycln
rev: v2.4.0
hooks:
- id: pycln
args: [--all]
# - repo: https://github.com/asottile/yesqa # - repo: https://github.com/asottile/yesqa
# rev: v1.4.0 # rev: v1.4.0
# hooks: # hooks:

@ -183,8 +183,8 @@ A heatmap generated with [Ultralytics YOLOv8](https://github.com/ultralytics/ult
# Heatmap Init # Heatmap Init
heatmap_obj = heatmap.Heatmap() heatmap_obj = heatmap.Heatmap()
heatmap_obj.set_args(colormap=cv2.COLORMAP_PARULA , heatmap_obj.set_args(colormap=cv2.COLORMAP_PARULA ,
imw=cap.get(4), # should same as cap height imw=im0.shape[1], # should same as im0 width
imh=cap.get(3), # should same as cap width imh=im0.shape[0], # should same as im0 height
view_img=True, view_img=True,
shape="circle") shape="circle")

@ -8,9 +8,9 @@ keywords: Ultralytics, YOLOv8, Roboflow, vector analysis, confusion matrix, data
[Roboflow](https://roboflow.com/?ref=ultralytics) has everything you need to build and deploy computer vision models. Connect Roboflow at any step in your pipeline with APIs and SDKs, or use the end-to-end interface to automate the entire process from image to inference. Whether you’re in need of [data labeling](https://roboflow.com/annotate?ref=ultralytics), [model training](https://roboflow.com/train?ref=ultralytics), or [model deployment](https://roboflow.com/deploy?ref=ultralytics), Roboflow gives you building blocks to bring custom computer vision solutions to your project. [Roboflow](https://roboflow.com/?ref=ultralytics) has everything you need to build and deploy computer vision models. Connect Roboflow at any step in your pipeline with APIs and SDKs, or use the end-to-end interface to automate the entire process from image to inference. Whether you’re in need of [data labeling](https://roboflow.com/annotate?ref=ultralytics), [model training](https://roboflow.com/train?ref=ultralytics), or [model deployment](https://roboflow.com/deploy?ref=ultralytics), Roboflow gives you building blocks to bring custom computer vision solutions to your project.
!!! Warning !!! Note
Roboflow users can use Ultralytics under the [AGPL license](https://github.com/ultralytics/ultralytics/blob/main/LICENSE) or procure an [Enterprise license](https://ultralytics.com/license) directly from Ultralytics. Be aware that Roboflow does **not** provide Ultralytics licenses, and it is the responsibility of the user to ensure appropriate licensing. Ultralytics offers two licensing options: the [AGPL-3.0 License](https://github.com/ultralytics/ultralytics/blob/main/LICENSE), an OSI-approved open-source license ideal for students and enthusiasts, and the [Enterprise License](https://ultralytics.com/license) for businesses seeking to incorporate our AI models into their products and services. For more details see [Ultralytics Licensing](https://ultralytics.com/license).
In this guide, we are going to showcase how to find, label, and organize data for use in training a custom Ultralytics YOLOv8 model. Use the table of contents below to jump directly to a specific section: In this guide, we are going to showcase how to find, label, and organize data for use in training a custom Ultralytics YOLOv8 model. Use the table of contents below to jump directly to a specific section:

@ -75,7 +75,7 @@ setup(
'mkdocs-material', 'mkdocs-material',
'mkdocstrings[python]', 'mkdocstrings[python]',
'mkdocs-redirects', # for 301 redirects 'mkdocs-redirects', # for 301 redirects
'mkdocs-ultralytics-plugin>=0.0.34', # for meta descriptions and images, dates and authors 'mkdocs-ultralytics-plugin>=0.0.35', # for meta descriptions and images, dates and authors
], ],
'export': [ 'export': [
'coremltools>=7.0', 'coremltools>=7.0',

@ -1,6 +1,6 @@
# Ultralytics YOLO 🚀, AGPL-3.0 license # Ultralytics YOLO 🚀, AGPL-3.0 license
__version__ = '8.0.229' __version__ = '8.0.230'
from ultralytics.models import RTDETR, SAM, YOLO from ultralytics.models import RTDETR, SAM, YOLO
from ultralytics.models.fastsam import FastSAM from ultralytics.models.fastsam import FastSAM

@ -579,6 +579,8 @@ class Exporter:
def export_engine(self, prefix=colorstr('TensorRT:')): def export_engine(self, prefix=colorstr('TensorRT:')):
"""YOLOv8 TensorRT export https://developer.nvidia.com/tensorrt.""" """YOLOv8 TensorRT export https://developer.nvidia.com/tensorrt."""
assert self.im.device.type != 'cpu', "export running on CPU but must be on GPU, i.e. use 'device=0'" assert self.im.device.type != 'cpu', "export running on CPU but must be on GPU, i.e. use 'device=0'"
f_onnx, _ = self.export_onnx() # run before trt import https://github.com/ultralytics/ultralytics/issues/7016
try: try:
import tensorrt as trt # noqa import tensorrt as trt # noqa
except ImportError: except ImportError:
@ -587,8 +589,8 @@ class Exporter:
import tensorrt as trt # noqa import tensorrt as trt # noqa
check_version(trt.__version__, '7.0.0', hard=True) # require tensorrt>=7.0.0 check_version(trt.__version__, '7.0.0', hard=True) # require tensorrt>=7.0.0
self.args.simplify = True self.args.simplify = True
f_onnx, _ = self.export_onnx()
LOGGER.info(f'\n{prefix} starting export with TensorRT {trt.__version__}...') LOGGER.info(f'\n{prefix} starting export with TensorRT {trt.__version__}...')
assert Path(f_onnx).exists(), f'failed to export ONNX file: {f_onnx}' assert Path(f_onnx).exists(), f'failed to export ONNX file: {f_onnx}'

Loading…
Cancel
Save