Docs Ruff codeblocks reformat and fix (#12847)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
be5cf7a033
commit
68031133fd
9 changed files with 167 additions and 178 deletions
|
|
@ -39,15 +39,15 @@ TensorBoard is conveniently pre-installed with YOLOv8, eliminating the need for
|
|||
|
||||
For detailed instructions and best practices related to the installation process, be sure to check our [YOLOv8 Installation guide](../quickstart.md). While installing the required packages for YOLOv8, if you encounter any difficulties, consult our [Common Issues guide](../guides/yolo-common-issues.md) for solutions and tips.
|
||||
|
||||
## Configuring TensorBoard for Google Collab
|
||||
## Configuring TensorBoard for Google Colab
|
||||
|
||||
When using Google Colab, it's important to set up TensorBoard before starting your training code:
|
||||
|
||||
!!! Example "Configure TensorBoard for Google Collab"
|
||||
!!! Example "Configure TensorBoard for Google Colab"
|
||||
|
||||
=== "Python"
|
||||
|
||||
```python
|
||||
```ipython
|
||||
%load_ext tensorboard
|
||||
%tensorboard --logdir path/to/runs
|
||||
```
|
||||
|
|
|
|||
|
|
@ -153,15 +153,16 @@ Experimentation by NVIDIA led them to recommend using at least 500 calibration i
|
|||
model = YOLO("yolov8n.pt")
|
||||
model.export(
|
||||
format="engine",
|
||||
dynamic=True, #(1)!
|
||||
batch=8, #(2)!
|
||||
workspace=4, #(3)!
|
||||
dynamic=True, # (1)!
|
||||
batch=8, # (2)!
|
||||
workspace=4, # (3)!
|
||||
int8=True,
|
||||
data="coco.yaml", #(4)!
|
||||
data="coco.yaml", # (4)!
|
||||
)
|
||||
|
||||
# Load the exported TensorRT INT8 model
|
||||
model = YOLO("yolov8n.engine", task="detect")
|
||||
|
||||
# Run inference
|
||||
result = model.predict("https://ultralytics.com/images/bus.jpg")
|
||||
```
|
||||
|
|
@ -385,36 +386,14 @@ Expand sections below for information on how these models were exported and test
|
|||
model = YOLO("yolov8n.pt")
|
||||
|
||||
# TensorRT FP32
|
||||
out = model.export(
|
||||
format="engine",
|
||||
imgsz:640,
|
||||
dynamic:True,
|
||||
verbose:False,
|
||||
batch:8,
|
||||
workspace:2
|
||||
)
|
||||
|
||||
out = model.export(format="engine", imgsz=640, dynamic=True, verbose=False, batch=8, workspace=2)
|
||||
|
||||
# TensorRT FP16
|
||||
out = model.export(format="engine", imgsz=640, dynamic=True, verbose=False, batch=8, workspace=2, half=True)
|
||||
|
||||
# TensorRT INT8 with calibration `data` (i.e. COCO, ImageNet, or DOTAv1 for appropriate model task)
|
||||
out = model.export(
|
||||
format="engine",
|
||||
imgsz:640,
|
||||
dynamic:True,
|
||||
verbose:False,
|
||||
batch:8,
|
||||
workspace:2,
|
||||
half=True
|
||||
)
|
||||
|
||||
# TensorRT INT8
|
||||
out = model.export(
|
||||
format="engine",
|
||||
imgsz:640,
|
||||
dynamic:True,
|
||||
verbose:False,
|
||||
batch:8,
|
||||
workspace:2,
|
||||
int8=True,
|
||||
data:"data.yaml" # COCO, ImageNet, or DOTAv1 for appropriate model task
|
||||
format="engine", imgsz=640, dynamic=True, verbose=False, batch=8, workspace=2, int8=True, data="coco8.yaml"
|
||||
)
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue