Running exe train yolo error #1260
Replies: 3 comments 1 reply
-
|
我也遇到一样的问题,有解决方案吗 |
Beta Was this translation helpful? Give feedback.
-
|
Hello @Magic00123, and thanks @dklyy6-art for confirming this issue! We appreciate you bringing this to our attention. Unfortunately, directly training Ultralytics models via the pre-compiled executable (EXE) version of X-AnyLabeling is currently not supported. This is primarily due to the inherent complexities and limitations in how Python handles subprocesses and dynamic script execution (like As you've already discovered, running X-AnyLabeling from its Python source allows the training functionality to work as expected. For now, please continue to use the Python environment for your YOLO model training needs. We understand this might be an inconvenience and appreciate your understanding! |
Beta Was this translation helpful? Give feedback.
-
|
关于这个问题,我找到了一个有效的解决方式 问题原因首先,源代码中通过动态创建train_script.py脚本,再利用subprocess创建子进程调用。由于subprocess本质是模拟命令行执行指令,运行 .py 格式的文件需要依赖 python解释器 ;而源代码通过sys.executable获取解释器路径,当使用pyInstaller打包成EXE后,从EXE启动时sys.executable会变为EXE自身的路径,最终导致生成的命令行指令无效,无法正常执行。 解决方案我将子进程创建方式改为使用multiprocessing:该方式无需依赖动态生成的train_script.py脚本和python解释器,仅需在主程序入口main() 函数执行前,调用一次 multiprocessing.freeze_support(),即可确保训练功能正常执行。 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Search before asking
X-AnyLabeling Component
No response
Bug
运行AnyLabeling的exe文件训练yolo模型,无法正确调用train_script.py。在python中训练是正常的。打包成exe就不正常。
发现训练yolo的时候train_script.py是根据参数动态生成的,请问有什么打包的方法,可以直接在exe中启动和训练。
Information
11
Link to a Reproducible Demonstration Video
1
Execution Mode
Pre-compiled Executable
Additional
No response
Are you willing to submit a PR?
Beta Was this translation helpful? Give feedback.
All reactions