From 8d2a32db77322ea83d3c501ed0e6c1fa966264da Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Tue, 26 Dec 2023 19:17:29 -0500 Subject: [PATCH] `ultralytics 8.0.230` TensorRT export hang fix (#7180) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 曾逸夫(Zeng Yifu) <41098760+Zengyf-CVer@users.noreply.github.com> Co-authored-by: CV & LLM & AIGC er 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> --- .pre-commit-config.yaml | 6 ++++++ docs/en/guides/heatmaps.md | 4 ++-- docs/en/integrations/roboflow.md | 4 ++-- setup.py | 2 +- ultralytics/__init__.py | 2 +- ultralytics/engine/exporter.py | 4 +++- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4c47d7e30c..9abb5d42c4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -76,6 +76,12 @@ repos: hooks: - id: docformatter + - repo: https://github.com/hadialqattan/pycln + rev: v2.4.0 + hooks: + - id: pycln + args: [--all] + # - repo: https://github.com/asottile/yesqa # rev: v1.4.0 # hooks: diff --git a/docs/en/guides/heatmaps.md b/docs/en/guides/heatmaps.md index a1c3a69b4d..c633832e19 100644 --- a/docs/en/guides/heatmaps.md +++ b/docs/en/guides/heatmaps.md @@ -183,8 +183,8 @@ A heatmap generated with [Ultralytics YOLOv8](https://github.com/ultralytics/ult # Heatmap Init heatmap_obj = heatmap.Heatmap() heatmap_obj.set_args(colormap=cv2.COLORMAP_PARULA , - imw=cap.get(4), # should same as cap height - imh=cap.get(3), # should same as cap width + imw=im0.shape[1], # should same as im0 width + imh=im0.shape[0], # should same as im0 height view_img=True, shape="circle") diff --git a/docs/en/integrations/roboflow.md b/docs/en/integrations/roboflow.md index b0bfb54cd8..0af75eda4a 100644 --- a/docs/en/integrations/roboflow.md +++ b/docs/en/integrations/roboflow.md @@ -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. -!!! 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: diff --git a/setup.py b/setup.py index 8463e70acb..48dc9918be 100644 --- a/setup.py +++ b/setup.py @@ -75,7 +75,7 @@ setup( 'mkdocs-material', 'mkdocstrings[python]', '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': [ 'coremltools>=7.0', diff --git a/ultralytics/__init__.py b/ultralytics/__init__.py index fa5418361f..4c19884b40 100644 --- a/ultralytics/__init__.py +++ b/ultralytics/__init__.py @@ -1,6 +1,6 @@ # Ultralytics YOLO 🚀, AGPL-3.0 license -__version__ = '8.0.229' +__version__ = '8.0.230' from ultralytics.models import RTDETR, SAM, YOLO from ultralytics.models.fastsam import FastSAM diff --git a/ultralytics/engine/exporter.py b/ultralytics/engine/exporter.py index de50252239..6819088f55 100644 --- a/ultralytics/engine/exporter.py +++ b/ultralytics/engine/exporter.py @@ -579,6 +579,8 @@ class Exporter: def export_engine(self, prefix=colorstr('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'" + f_onnx, _ = self.export_onnx() # run before trt import https://github.com/ultralytics/ultralytics/issues/7016 + try: import tensorrt as trt # noqa except ImportError: @@ -587,8 +589,8 @@ class Exporter: import tensorrt as trt # noqa check_version(trt.__version__, '7.0.0', hard=True) # require tensorrt>=7.0.0 + self.args.simplify = True - f_onnx, _ = self.export_onnx() LOGGER.info(f'\n{prefix} starting export with TensorRT {trt.__version__}...') assert Path(f_onnx).exists(), f'failed to export ONNX file: {f_onnx}'