ultralytics / yolov5

YOLOv5 ๐Ÿš€ in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
49.97k stars 16.15k forks source link

Turning detect.py into a .exe #434

Closed MrCri5py closed 4 years ago

MrCri5py commented 4 years ago

โ”Question

I hope you are well.

I've got a question about creating an executable using YOLOv5. How do we go about to convert the detect. py script to an .exe? I have tried using Pyinstaller and cx_Freeze but this gives PyInstallerImportError: Failed to load dynlib/dll "caffe2_detectron_ops_gpu.dll". Your feedback will be highly appreciated. Thank you

Kind regards

Additional context

github-actions[bot] commented 4 years ago

Hello @MrCri5py, thank you for your interest in our work! Please visit our Custom Training Tutorial to get started, and see our Jupyter Notebook Open In Colab, Docker Image, and Google Cloud Quickstart Guide for example environments.

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 model or data training question, please note that Ultralytics does not provide free personal support. As a leader in vision ML and AI, we do offer professional consulting, from simple expert advice up to delivery of fully customized, end-to-end production solutions for our clients, such as:

For more information please visit https://www.ultralytics.com.

WelkinU commented 4 years ago

In your PyInstaller .spec file, try adding caffe2_detectron_ops_gpu.dll to the binaries.

Example: binaries=[('path\to\your\caffe2_detectron_ops_gpu.dll' , '.')]

Note: If you use a conda environment the path should be similar to: [ANACONDA_ROOT]\envs\[ENV_NAME]\Lib\site-packages\torch\lib\caffe2_detectron_ops_gpu.dll

MrCri5py commented 4 years ago

Thank you for your response @WelkinU . I have added the .DLL path to the binary and still gives the same issue. I've added --paths "path containing the .DLL", this then changed the error to PyInstallerImportError: Failed to load dynlib/dll "caffe2_nvrtc.dll" Using Windows 10 build 18363.959 Anaconda Pyinstaller 3.6 Torchvision 0.2.2. Post 3 Pytorch 1.5.1 Cuda 10.2 Cuda toolkit 10.1.243

github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

blackCmd commented 3 years ago

@WelkinU ๋‹ต๋ณ€ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค . ๋ฐ”์ด๋„ˆ๋ฆฌ์— .DLL ๊ฒฝ๋กœ๋ฅผ ์ถ”๊ฐ€ํ–ˆ์ง€๋งŒ ์—ฌ์ „ํžˆ ๋™์ผํ•œ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค. --paths "path ํฌํ•จ .DLL"์„ ์ถ”๊ฐ€ํ•˜๋ฉด PyInstallerImportError: Failed to load dynlib/dll "caffe2_nvrtc.dll" Using Windows 10 build 18363.959 Anaconda Pyinstaller 3.6 Torchvision 0.2.2. Post 3 Pytorch 1.5.1 Cuda 10.2 Cuda ํˆดํ‚ท 10.1.243

I've met he error too. How to solve?