PaddlePaddle / PaddleDetection

Object Detection toolkit based on PaddlePaddle. It supports object detection, instance segmentation, multiple object tracking and real-time multi-person keypoint detection.
Apache License 2.0
12.78k stars 2.89k forks source link

paddledet环境下可以执行,使用pyinstaller编译后运行失败 #6899

Open usuixingyili opened 2 years ago

usuixingyili commented 2 years ago

问题描述 Please describe your issue

导入的是deploy/python/infer.py

Traceback (most recent call last): File "pedestrain_infer.py", line 7, in from infer import Detector File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "PyInstaller\loader\pyimod02_importers.py", line 493, in exec_module File "infer.py", line 25, in import paddle File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "PyInstaller\loader\pyimod02_importers.py", line 493, in exec_module File "paddle__init.py", line 25, in File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "PyInstaller\loader\pyimod02_importers.py", line 493, in exec_module File "paddle\framework__init.py", line 17, in File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "PyInstaller\loader\pyimod02_importers.py", line 493, in exec_module File "paddle\framework\random.py", line 16, in File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "PyInstaller\loader\pyimod02_importers.py", line 493, in exec_module File "paddle\fluid__init.py", line 45, in File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "PyInstaller\loader\pyimod02_importers.py", line 493, in exec_module File "paddle\fluid\dataset.py", line 19, in File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "PyInstaller\loader\pyimod02_importers.py", line 493, in exec_module File "paddle\utils\init__.py", line 28, in File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "PyInstaller\loader\pyimod02_importers.py", line 493, in exec_module File "paddle\utils\cpp_extension\init.py", line 15, in File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "PyInstaller\loader\pyimod02_importers.py", line 493, in exec_module File "paddle\utils\cpp_extension\cpp_extension.py", line 20, in File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "PyInstaller\loader\pyimod02_importers.py", line 493, in exec_module File "setuptools\init.py", line 8, in File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "PyInstaller\loader\pyimod02_importers.py", line 493, in exec_module File "_distutils_hack\override.py", line 1, in File "_distutils_hack\init__.py", line 77, in do_override File "_distutils_hack\init__.py", line 64, in ensure_local_distutils AssertionError: C:\Users\xingyili\AppData\Local\Temp_MEI230122\distutils\core.pyc [10480] Failed to execute script 'pedestrain_infer' due to unhandled exception!

wangxinxin08 commented 2 years ago

windows参考https://zhuanlan.zhihu.com/p/268657833 以及 https://zhuanlan.zhihu.com/p/280206376

usuixingyili commented 2 years ago

我的客户端代码是python写的呢,cpp编译怎么集成。

wangxinxin08 commented 2 years ago

这个问题建议自行搜索解决

usuixingyili commented 2 years ago

这个问题建议自行搜索解决

用nuitka解决了问题,谢谢。