caffe-windows
caffe-windows copied to clipboard
How to use Python
Hi
I have successfully build caffe-windows
(VS2017 cuda 9.1 ) with python 3 (using 2015 toolset)
Now I don't know how to use this in python project.
How do I import the python tried using
import caffe
and the result was
ModuleNotFoundError: No module named 'caffe'
tried a suggestion found in issues - ([https://github.com/happynear/caffe-windows/issues/225]#225)
import sys sys.path.append("/caffe-windows/python") import caffe
this also did not work received this error
import caffe
Traceback (most recent call last): File "
", line 1, in File "C:\Users\xxxx\source\repos\caffe-windows-ms\caffe-windows-ms\python\caffe_init_.py", line 1, in from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer File "C:\Users\xxxx\source\repos\caffe-windows-ms\caffe-windows-ms\python\caffe\pycaffe.py", line 13, in from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver,
ModuleNotFoundError: No module named 'caffe._caffe'
Also tried coping into anconda\lib\site-packges (as suggested by http://www.shaneahmed.com/2017/07/build-caffe-pycaffe-and-matcaffe-on.html) but got the same error.
I would be glad for guidance. Thanks in advance.
Seems Like found the answer, 2 steps
- Add "..\caffe-windows-ms\Build\x64\Release" folder to windows PATH
- (using anaconda) copy ",,\caffe-windows-ms\Build\x64\Release\pycaffe\caffe" folder into "C:\ProgramData\Anaconda3\Lib\site-packages" (or wherever anaconda is installed on your computer)
Now import caffe works, still did not check actual code.