BabitMF / bmf

Cross-platform, customizable multimedia/video processing framework. With strong GPU acceleration, heterogeneous design, multi-language support, easy to use, multi-framework compatible and high performance, the framework is ideal for transcoding, AI inference, algorithm integration, live video streaming, and more.
https://babitmf.github.io/
Apache License 2.0
809 stars 71 forks source link

ModuleNotFoundError: No module named 'bmf.lib._hmp' #119

Open JackLau1222 opened 6 months ago

JackLau1222 commented 6 months ago

按照README.md 的引导 建立conda虚拟环境,下载完相关依赖运行demo后找不到hmp库

(deoldify_py39) root@bd912f7bf229:~/bmf/bmf/demo/colorization_python# python3.9 deoldify_demo.py 
Traceback (most recent call last):
  File "/root/bmf/bmf/demo/colorization_python/deoldify_demo.py", line 1, in <module>
    import bmf
  File "/root/bmf/output/bmf/__init__.py", line 3, in <module>
    from bmf.python_sdk.module_functor import make_sync_func
  File "/root/bmf/output/bmf/python_sdk/__init__.py", line 1, in <module>
    from .module_functor import make_sync_func, ProcessDone
  File "/root/bmf/output/bmf/python_sdk/module_functor.py", line 1, in <module>
    import bmf.lib._hmp
ModuleNotFoundError: No module named 'bmf.lib._hmp'

相关依赖下载无误

(deoldify_py39) root@bd912f7bf229:~/bmf/bmf/demo/colorization_python# pip3 list | grep Babit
BabitMF                  0.0.9
BabitMF-GPU              0.0.9

在硬盘中也能找到_hmp.cpython-39-x86_64-linux-gnu.so这个库文件

(deoldify_py39) root@bd912f7bf229:~/bmf/bmf/demo/colorization_python# ls /root/miniconda3/envs/deoldify_py39/lib/python3.9/site-packages/bmf/lib/
_bmf.cpython-39-x86_64-linux-gnu.so  libbenchmark.a       libbmf_module_sdk.so        libbmf_py_loader.so      libbuiltin_modules.so.0.0.9  libengine.so.0.0.9  libhmp.so.1
_hmp.cpython-39-x86_64-linux-gnu.so  libbenchmark_main.a  libbmf_module_sdk.so.0      libbuiltin_modules.so    libengine.so                 libfmt.a            libhmp.so.1.2.0
libbackward.a                        libbmf_go_loader.so  libbmf_module_sdk.so.0.0.9  libbuiltin_modules.so.0  libengine.so.0               libhmp.so           libspdlog.a
HuHeng commented 6 months ago

确认一下,conda环境下的pip和系统pip是不是有些冲突

JackLau1222 commented 6 months ago

我使用的是官方提供的docker镜像 系统pip是镜像原来的python3.8附带的

root@bd912f7bf229:~/bmf# pip --version
pip 23.2.1 from /usr/local/lib/python3.8/dist-packages/pip (python 3.8)

虚拟环境的pip指向python3.9

(deoldify_py39) root@bd912f7bf229:~/bmf/bmf/demo/colorization_python# pip3 --version
pip 24.0 from /root/miniconda3/envs/deoldify_py39/lib/python3.9/site-packages/pip (python 3.9)
(deoldify_py39) root@bd912f7bf229:~/bmf/bmf/demo/colorization_python# pip --version
pip 24.0 from /root/miniconda3/envs/deoldify_py39/lib/python3.9/site-packages/pip (python 3.9)
JackLau1222 commented 6 months ago

我在另一台机器上再次尝试使用conda环境(系统python3.8可以正常跑demo),具体命令如下

  327  wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
  328  ls
  329  bash ./Miniconda3-latest-Linux-x86_64.sh 
  330  source ~/.bashrc
  331  conda create -n deoldify_py39 python=3.9
  332  conda activate deoldify_py39
  333  cd bmf/bmf/demo/colorization_python/
  334  ls
  335  pip3 --version
  336  pip3.9 list
  337  pip --version
  338  pip install ./DeOldify/requirements-colab.txt 
  339  pip install -r ./DeOldify/requirements-colab.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
  340  pip3 list
  341  pip install BabitMF BabitMF-GPU -i https://pypi.tuna.tsinghua.edu.cn/simple
  342  ls
  343  python3 --version
  344  python3 deoldify_demo.py 

依然是同样报错

(deoldify_py39) root@73559b1846e1:~/bmf/bmf/demo/colorization_python# python3 deoldify_demo.py
Traceback (most recent call last):
  File "/root/bmf/bmf/demo/colorization_python/deoldify_demo.py", line 1, in <module>
    import bmf
  File "/root/bmf/output/bmf/__init__.py", line 3, in <module>
    from bmf.python_sdk.module_functor import make_sync_func
  File "/root/bmf/output/bmf/python_sdk/__init__.py", line 1, in <module>
    from .module_functor import make_sync_func, ProcessDone
  File "/root/bmf/output/bmf/python_sdk/module_functor.py", line 1, in <module>
    import bmf.lib._hmp
ModuleNotFoundError: No module named 'bmf.lib._hmp'
(deoldify_py39) root@73559b1846e1:~/bmf/bmf/demo/colorization_python# python3 --version
Python 3.9.19
(deoldify_py39) root@73559b1846e1:~/bmf/bmf/demo/colorization_python# pip --version
pip 24.0 from /root/miniconda3/envs/deoldify_py39/lib/python3.9/site-packages/pip (python 3.9)