ImportError: No module named caffe2.python
Hi folks,
I was able to build Caffe2 on Windows 10 with Anaconda2 without issues. When I tried to run the RNN sample from: https://caffe2.ai/docs/RNNs-and-LSTM-networks.html
I see this error:
python char_rnn.py --train_data shakespeare.txt
Traceback (most recent call last):
File "char_rnn.py", line 8, in <module>
from caffe2.python import core, workspace, cnn, utils
ImportError: No module named caffe2.python
I've copied the caffe2_pybind11_state.pyd file into the Anaconda2\DLLs folder.
What did I miss?
Thanks for any suggestions. Wes
Seems like a pythonpath issue - you should set your pythonpath to where caffe2 is built/installed. This link would be helpful:
http://stackoverflow.com/questions/3701646/how-to-add-to-the-pythonpath-in-windows-7
I have this issue too. Here's what I did:
- Copy
caffe2_pybind11_state.pydto 'C:\Python27amd64\DLLs' - In python interpreter:
>>> import sys
>>> sys.path
- Verify 'C:\Python27amd64\DLLs' is in that path
- Interpreter:
>>> import caffe2Result:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named caffe2
Ah, okay, Yangqing is right. The following interpreter line resolves the issue:
>>> sys.path.append('C:\\Users\\<username>\\Source\\Repos\\Python\\caffe2\\build')
import caffe2
Works.
I have this issue.the folder 'C:\Users\