Yolov8 Pyinstaller可执行文件不断重新运行自身。

huangapple go评论85阅读模式
英文:

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)

Error Image

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.

huangapple
  • 本文由 发表于 2023年8月4日 05:49:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/76831790.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定