ncnn import error

ulmd4ohb  于 2022-10-22  发布在  其他
关注(0)|答案(9)|浏览(222)

In Ubuntu 16.04 LTS,cmake,make and setup are all done.
python import ncnn
ModuleNotFoundError: No module named 'ncnn.ncnn'.
What should I do?

fcipmucu

fcipmucu3#

this comes from the file "init.py"; in line 15 ------> [ from .ncnn import *], but no solution was found.

qgelzfjb

qgelzfjb4#

first install pybind11
second cd ncnn/python ' python setep.py install '
i successed in ubuntu 20.04

raogr8fs

raogr8fs5#

first install pybind11

second cd ncnn/python ' python setep.py install '

i successed in ubuntu 20.04

i follow your steps,but still has the same problem,could you give a detailed step,thx a lot!!!

pxyaymoc

pxyaymoc6#

first install pybind11
second cd ncnn/python ' python setep.py install '
i successed in ubuntu 20.04

i follow your steps,but still has the same problem,could you give a detailed step,thx a lot!!!

I guess you forget make the NCNN , you should first make NCNN in the markdown file in NCNN/python you can see more

axkjgtzd

axkjgtzd7#

first install pybind11
second cd ncnn/python ' python setep.py install '
i successed in ubuntu 20.04

i follow your steps,but still has the same problem,could you give a detailed step,thx a lot!!!

Try to build ncnn withgcc-7. The detailed steps are:

export CC=<path/of/gcc-7>
export CXX=<path/of/g++7>
cd <path/to/ncnn/root/directory>
make build
cd build
cmake .. -DNCNN_PYTHON=ON
make -j8 && make install
cd ../python
python setup.py install
uttx8gqw

uttx8gqw8#

i follow lvhan028 commented on 26 Sep
and in the last step not cd ../python
python setup.py install
but cd ../
pip3 install .
then is ok and you can read the readme.md in the folder named "python"

aiazj4mn

aiazj4mn9#

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.6 LTS
Release:	18.04
Codename:	bionic
  • First install pybind11
  • Second install ncnn
$ pip install pybind11 
$ pip install ncnn

相关问题