You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 train_script.py) when an application is bundled into a standalone executable.
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!
Activity
dklyy6-art commentedon Sep 4, 2025
我也遇到一样的问题,有解决方案吗
CVHub520 commentedon Sep 4, 2025
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
train_script.py) when an application is bundled into a standalone executable.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!
wwPig commentedon Dec 30, 2025
关于这个问题,我找到了一个有效的解决方式
问题原因
首先,源代码中通过动态创建train_script.py脚本,再利用subprocess创建子进程调用。由于subprocess本质是模拟命令行执行指令,运行 .py 格式的文件需要依赖 python解释器 ;而源代码通过sys.executable获取解释器路径,当使用pyInstaller打包成EXE后,从EXE启动时sys.executable会变为EXE自身的路径,最终导致生成的命令行指令无效,无法正常执行。
解决方案
我将子进程创建方式改为使用multiprocessing:该方式无需依赖动态生成的train_script.py脚本和python解释器,仅需在主程序入口main()函数执行前,调用一次multiprocessing.freeze_support(),即可确保训练功能正常执行。