-
Notifications
You must be signed in to change notification settings - Fork 18.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ImportError: dynamic module does not define module export function (PyInit__caffe) #6054
Comments
Hi monajalal, |
I have the same issue, but in my case it was working just after compiling source. I have exited a shell, and after opening it again problem started.
|
Thank you so much. I'm now OK and my Caffe is working well.
…On Fri, Feb 9, 2018 at 12:10 AM, sunblade ***@***.***> wrote:
I have the same issue, but in my case it was working just after compiling
source. I have exited a shell, and after opening it again problem started.
.bashrc
export PYTHONPATH=$HOME/caffe/python:$PYTHONPATH
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#6054 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AhLwKKpcBxVhprREenxeMY2Oxy_B7xDjks5tSzGjgaJpZM4QccHu>
.
|
@nn-ww Hi, how did you solve this issue? Thanks! |
@pencilzhang Did you fix it? I ran into the same dynamic error when import caffe. |
I save my command for caffe installation. I have attached this file to you.
I hope you'll OK.
On Thu, Mar 22, 2018 at 9:41 AM, WUhailing ***@***.***> wrote:
@pencilzhang <https://github.com/pencilzhang> Did you fix it? I ran into
the same dynamic error when import caffe.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6054 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AhLwKCupIg0lcauDPnrzpa1FFO1Y5HxGks5tgxZOgaJpZM4QccHu>
.
which conda
conda info --envs
source activate py36
sudo apt-get upgrade
sudo apt-get install -y build-essential cmake git pkg-config
sudo apt-get install -y libprotobuf-dev libleveldb-dev libsnappy-dev protobuf-compiler
sudo apt-get install -y libatlas-base-dev
sudo apt-get install -y --no-install-recommends libboost-all-dev
sudo apt-get install -y libgflags-dev libgoogle-glog-dev liblmdb-dev
sudo apt install build-essential
conda install atlas boost gflags glog hdf5 leveldb lmdb openblas protobuf
conda install tensorflow-gpu
git clone https://github.com/BVLC/caffe
cd caffe
cp Makefile.config.example Makefile.config
======================================================
Change the following in Makefile.config
1.Uncomment OpenCV3
OPENCV_VERSION := 3
2. Comment the py2.7 path
#PYTHON_INCLUDE := /usr/include/python2.7 \
# /usr/lib/python2.7/dist-packages/numpy/core/include
3. change for anaconda python3.6
ANACONDA_HOME := $(HOME)/anaconda3/envs/py36
PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
$(ANACONDA_HOME)/include/python3.6m \
$(ANACONDA_HOME)/lib/python3.6/site-packages/numpy/core/include
4. Change python_lib
#PYTHON_LIB := /usr/lib
PYTHON_LIB := $(ANACONDA_HOME)/lib
==========================================================
make all
make pycaffe
make all
mkdir build
cd build
cmake -D python_version=3 ..
make all
make install
cd ..
conda install cython scikit-image ipython h5py nose pandas protobuf pyyaml jupyter
cd python
sed -i -e 's/python-dateutil>=1.4,<2/python-dateutil>=2.0/g' requirements.txt
cd caffe/python
for req in $(cat requirements.txt); do pip install $req; done
export PYTHONPATH=~/caffe/python/:$PYTHONPATH
export PYTHONPATH=/home/dell/caffe/python:$PYTHONPATH
echo $PYTHONPATH
cd ..
make runtest
cd python
import caffe
|
@nn-ww Thanks. It turns out to be 'cmake' issue, so switch to 'make', it works. |
Thanks. I got 'import caffe' and it works well.
…On Fri, Mar 23, 2018 at 4:37 PM, WUhailing ***@***.***> wrote:
@nn-ww <https://github.com/nn-ww> Thanks. It turns out to be 'cmake'
issue, so switch to 'make', it works.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6054 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AhLwKGnZdDM_oydneP6kJour25mSAy-Uks5thMlLgaJpZM4QccHu>
.
|
Thank you @nn-ww . I switch to cmake then everything works fine on a Mac OS system. @WUhailing |
I've solved the problem. In my case, in the first anaconda envs, the protoc is not compatible with pycaffe (caffe), so I entered another envs. |
This problem happens when you use python2 build with python3 Just uncomment:
|
…function (PyInit__caffe) #6054 see BVLC/caffe#6054 Signed-off-by: Huaqi Fang <[email protected]>
Hi @mrgloom ,
During handling of the above exception, another exception occurred: import FreeCAD |
for futur readers, this error is caused because of the default python version is set to 3.x.x, I set it to python 2 using |
for what it's worth, I got this error because I had compiled Caffe for python2.7 but I'm running python 3. So I was in the inverse situation that @mjrlgue mentions above. The solution was to add git clone -b ${CLONE_TAG} --depth 1 https://github.com/BVLC/caffe.git . && \
pip install --upgrade pip && \
cd python && for req in $(cat requirements.txt) pydot; do pip install $req; done && cd .. && \
mkdir build && cd build && \
cmake -DCPU_ONLY=1 -D python_version=3 .. && \
make -j2 (note that the above is for a CPU build) |
@alex9311 This works for me, really appreciate that. My platform is Nvidia Jetson AGX Xavier. |
Here is the Makefile.config
Please suggest what is wrong and how to fix it?
[jalal@goku caffe]$ uname -a
Linux goku.bu.edu 3.10.0-693.5.2.el7.x86_64 #1 SMP Fri Oct 20 20:32:50 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[jalal@goku caffe]$ lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.4.1708 (Core)
Release: 7.4.1708
Codename: Core
The text was updated successfully, but these errors were encountered: