Fix yolov9 export script (#17744)

* Fix yolov9 export script

* Fix typo

* Update object_detectors.md
This commit is contained in:
Nicolas Mowen 2025-04-16 14:52:21 -06:00 committed by GitHub
parent 6a487a5dc7
commit 8744da3bf8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -980,6 +980,16 @@ YOLOv9 models can be exported using the below code or they [can be downloaded fr
```sh
git clone https://github.com/WongKinYiu/yolov9
cd yolov9
wget -O yolov9-t.pt "https://github.com/WongKinYiu/yolov9/releases/download/v0.1/yolov9-t-converted.pt"
python3 export.py --weights ./yolov9-t-converted.pt --imgsz 320 --simplify
# setup the virtual environment so installation doesn't affect main system
python3 -m venv ./
bin/pip install -r requirements.txt
bin/pip install onnx onnxruntime onnx-simplifier>=0.4.1
# download the weights
wget -O yolov9-t.pt "https://github.com/WongKinYiu/yolov9/releases/download/v0.1/yolov9-t-converted.pt" # download the weights
# prepare and run export script
sed -i "s/ckpt = torch.load(attempt_download(w), map_location='cpu')/ckpt = torch.load(attempt_download(w), map_location='cpu', weights_only=False)/g" ./models/experimental.py
python3 export.py --weights ./yolov9-t.pt --imgsz 320 --simplify --include onnx
```