I'm trying to use Caffe in Anaconda3 on windows, but when I try to import caffe in iPython, it shows this error:
ImportError: No module named caffe
I tried to add a new system variable named PYTHONPATH which looks like this:
C:\Users\Hadi\Anaconda3;C:\Projects\caffe\python\caffe;C:\Projects\caffe\python
It still shows the same error. I would appreciate if anyone mentioned what am I missing here?
REM Create a new conda environment to install Caffe REM You can use python 3.5, 3.6 or 3.7
conda create -n caffe python=3.7
REM activate the environment REM Depending on your conda version you may have to use activate caffe
conda activate caffe
REM add the anaconda channel to resolve all dependencies
conda config --add channels anaconda
REM Install caffe with cuda support or install caffe-cpu if you do not want CUDA support
conda install caffe -c willyd
Answer taken from here: https://github.com/BVLC/caffe/issues/6569#issuecomment-432491851
caffe doesn't have support for windows as it have for others. After trying many things, i am able to import caffe. The best solution i find is the git link https://github.com/Microsoft/caffe .
Create a virtual environment in Anaconda, python = 3.7 and then follow the instructions.
You would have to make changes CommonSettings.props as mentioned in the documentation for CUDA and cuDNN if you would be using it with CPU only.
clone repository to the location and copy caffe folder to .\anaconda3\envs\env_caffe\Lib\site-packages location as stated in the documentation .
and finally un the following commands from elevated command prompt:
conda install --yes numpy scipy matplotlib scikit-image pip pip install protobuf.
Read the instruction carefully and then proceed.
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