英文:
Yolov8 Pyinstaller exe file constantly reruns itself
问题
我使用Pyinstaller将我用Yolov8开发的非常简单的应用程序转换成了exe。脚本运行得很好,但当我运行exe文件时,它不断地重新运行自身。我的代码如下:
from ultralytics import YOLO
model = YOLO("best.pt")
results = model.track("./last.mp4", show=True)
将其转换为exe文件的Pyinstaller命令:
pyinstaller main.py --no-console
额外说明:
在将脚本转换为exe文件后,我手动在exe文件的位置创建了ultralytics/cfg/default.yaml文件,因为它报错找不到default.yaml文件。
我还尝试过转换成onefile,但仍然不起作用。
英文:
I converted a very simple application that I developed with Yolov8 to exe with pyinstaller. The script runs very well but when I run the exe file it constantly reruns itself. My codes are as follows:
from ultralytics import YOLO
model = YOLO("best.pt")
results = model.track("./last.mp4", show=True)
Pyinstaller command to convert it to exe file:
pyinstaller main.py --no-console
Additional note:
After converting the script to an exe file, I manually created the ultralytics/cfg/default.yaml file at the location of the exe file because it gave an error that ultralytics could not find the default.yaml file.
I also tried converting into onefile but still it doesn't work.
答案1
得分: 0
问题与'cpuinfo'模块相关。我还不知道原因,但从Ultralytics代码库中移除相关代码解决了问题。
英文:
I discovered that the issue is related to the 'cpuinfo' module. I don't yet know the reason, but removing the relevant code from the Ultralytics codebase resolved the problem.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论