I install caffe and it worked fine. In cmd, I can import it use python, but when I use jupyter notebook, I can't import it.


How can I solve it?
It looks like you have put /home/mltitan/Workspace/caffepython in the path instead of /home/mltitan/Workspace/caffe/python which may have been your intention.
Adding the strings together as you have done will not insert the slash in the path. Best practise is to use os.path.join to handle this:
import os
import sys
caffe_root = '/home/mltitan/Workspace/caffe'
sys.path.insert(0, os.path.join(caffe_root, 'python'))
import caffe
Does that help?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With