Closed mxchinegod closed 8 years ago
Check your ImportError
message more carefully:
ImportError: libcudart.so.7.5: cannot open shared object file: No such file or directory
You probably need to set up your environment to find CUDA: https://github.com/NVIDIA/DIGITS/blob/digits-4.0/docs/InstallCuda.md#environment
EDIT
Oh, I see you already noticed that. Sorry.
I'm excited to read and hopefully fix the error emergent from using sys to append a path in the python environment.
That being said, is there a reason/way to fix the issue preceding that whereby it can't find caffe? I notice caffe does not install itself into site-packages... (not sure if I doublechecked this on my own system but I've read this and it would explain all of the references I must make)
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
export PATH=$PATH:/usr/local/cuda-7.5/bin
export LD_LIBRARY_PATH=:/usr/local/cuda-7.5/lib64
export PYTHONPATH=/home/ubuntu/caffe/python:$PYTHONPATH
my ~/.bashrc fyi
I notice caffe does not install itself into site-packages...
See discussion here: https://github.com/BVLC/caffe/issues/3925
Well I'm not really inquiring as to the reasons or how to make it more of a traditional package to be frank... I just want to know why it can't find anything when my environment variables seem wholesome. I'm fine with it being quirky and different if it works :P
EDIT: so the Nvidia CUDA environment guide helped and a live python environment using sys.path.append now allows for caffe to be imported as well but if I'm using a wrapper, I have to do this every time?
Oh I see. Sorry, I didn't read your OP very carefully :astonished:
Dunno. Your setup looks pretty standard to me.
Dunno. Your setup looks pretty standard to me.
Well that's good news at least!
EDIT: I ended up getting it to work by modifying some code in a script and caffe to fit my situation. Thanks for the help. It's all working now.
Glad you got it working.
i got the same error! anyone has solved this please give me the point. i compiled correctly but still it give me no caffe module found. i checked paths for cuda and caffe, both of them were right. please help me with this issue:
export PATH=/usr/local/cuda-8.0/bin:$PATH export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH export CAFFE_ROOT=/Caffe export PYTHONPATH=/Caffe/python:$PYTHONPATH
@sayadyaghoobi I got the same error. Did you solve it?
@selinachenxi i just added a caffe's python path to my python environment :
try this, if you face the errors (whatever it works or not), just email me, feel free
Hi, I tried many times, just doesn't work. I even copied the python folder under the sitepackages in anaconda, still doesn't work. I am thinking might be the version problem. I am using the caffe provided by the openpose code. It only generates _caffe.so, but not pycaffe.pyc etc. I have no problem to install in my own computer, just not on the server without root.
On 15 June 2017 at 07:06, sayadyaghoobi notifications@github.com wrote:
hi, yes! i just added the caffe's python directory to my python environment : import sys
sys.path.append('/Caffe/python')
import caffe
then it solved! try this if you got an errors just email me (whatever it works or not), feel free.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/BVLC/caffe/issues/4389#issuecomment-308637787, or mute the thread https://github.com/notifications/unsubscribe-auth/ALM45AQKC6dUdyr7h3V_TfH8f2aeHJuxks5sEMnigaJpZM4JBYiG .
are you sure that pycaffe compiled ? make pycaffe
Add the module directory to your $PYTHONPATH by export PYTHONPATH=/path/to/caffe/python:$PYTHONPATH or the like for import caffe.
I am not sure in fact. Because I am using 3rd party provided caffe, it might have problem about their make for pycaffe. I shall try on the official version.
On 15 June 2017 at 12:34, sayadyaghoobi notifications@github.com wrote:
are you sure that pycaffe compiled ?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/BVLC/caffe/issues/4389#issuecomment-308705242, or mute the thread https://github.com/notifications/unsubscribe-auth/ALM45OUnfZvygwyFgizE-pzuvD2c3LBKks5sERbIgaJpZM4JBYiG .
So I got this error when running a python script that wraps around caffe. I was like "oh right, go fix .bashrc so it knows what you're trying to do". A la
export PYTHONPATH=/home/ubuntu/caffe/python
(also later down here it gives a similar error for CUDA, and the paths for that are also correct in .bashrc making me suspect there is a larger issue here)
it still doesn't work. I tried the test scripts that come with caffe so it's fine and works properly but just not through python importing. Nothing went wrong during compiling caffe and my Makefile.config directs to the library correctly by default unless I'm missing something. I can paste that as well (this is ubuntu 14.04).
Lastly...
I checked, everything is in the right place, last thing I checked was:
cd /home/ubuntu/caffe/
and then
sudo pip install -r ./python/requirements.txt
And it installed some updates but nothing changed. I've restarted terminals, etc. Restarted, sourced bashrc, "make pycaffe" and nothing needs to be done it says.
What's up? Am I crazy? Not using Anaconda or anything, just py2.7 default + satisfied requirements from the .txt