0

I work with caffe and I can run my python code and train network successfully. but I need to draw some plots interactively during trainig so I try to use jupyter notebook and IPython but jupyter cannot import caffe and raise this error:

ImportError: libcudart.so.8.0: cannot open shared object file: No such file or directory

Any suggestion to solve the problem or to live plot without IPython?? Thank you!

Somayyeh Ataei
  • 307
  • 2
  • 13
  • Are your installation relying on different versions of python? If so, consider installing caffe on Jupiter environment – DDS May 25 '18 at 10:10
  • @DDS I installed jupyter on both version of python and got the same error – Somayyeh Ataei May 25 '18 at 11:23
  • @SomayyehAtaeiKachouei this is not a jupyter notebook error, but error with tensorflow and CUDA drivers (for GPU support). Take a look at [this](https://stackoverflow.com/questions/44865253/libcublas-so-8-0-error-with-tensorflow) – Sangram Gaikwad May 25 '18 at 12:31
  • Possible duplicate of [libcublas.so.8.0 error with tensorflow](https://stackoverflow.com/questions/44865253/libcublas-so-8-0-error-with-tensorflow) – Venkatesh Wadawadagi May 25 '18 at 12:46
  • @DOS Thank you, but I check this links and also check my paths as I said I run caffe and tensorflow on my system but It's seems theres is a problem for IPython to recognize caffe – Somayyeh Ataei May 25 '18 at 13:30

1 Answers1

0

Add export PYTHONPATH="${PYTHONPATH}:/caffe/path/caffe/python" to the end of ~/.profile or ~/.bashrc or ~/.bash_profile file. After adding the above line to the file run source whichever file you have edited.

If your are using bash, ~/.bashrc is to be edited and if your on MAC, ~/.profile to be edited

For only one Jupyter Session

import sys caffe_root = '/home/basha/caffe/python' sys.path.insert(0,caffe_root) import caffe

Basha
  • 11
  • 3
  • I did this all and as I said I am running caffe and tensorflow on my system but I think somthing about IPyhton and Jupyter goes wrong. – Somayyeh Ataei May 25 '18 at 21:41
  • For me, running `python3` and then `import caffe`, works fine. running `jupyter notebook` and then `import caffe`, is what does not work. @SomayyehAtaei – M.K Sep 14 '22 at 14:25