简体   繁体   English

Windows 10中的Caffe模块安装失败

[英]Caffe module installation failed in Windows 10

I am very new to caffe. 我对咖啡很陌生。 I was following this link: http://adilmoujahid.com/posts/2016/06/introduction-deep-learning-python-caffe/ 我正在关注此链接: http : //adilmoujahid.com/posts/2016/06/introduction-deep-learning-python-caffe/

When I ran this command: python create_lmdb.py , I got the following error: 当我运行以下命令: python create_lmdb.py时 ,出现以下错误:

File "create_lmdb.py", line 19, in , import caffe ; 在文件“ create_lmdb.py”的第19行中,导入caffe; ImportError: No module named 'caffe' ImportError:没有名为“ caffe”的模块

I tried to install caffe using this link : https://github.com/BVLC/caffe/tree/windows , specially the following codes: 我尝试使用以下链接安装caffe: https : //github.com/BVLC/caffe/tree/windows ,特别是以下代码:

    C:\Projects> git clone https://github.com/BVLC/caffe.git
    C:\Projects> cd caffe
    C:\Projects\caffe> git checkout windows
    :: Edit any of the options inside build_win.cmd to suit your needs
    C:\Projects\caffe> scripts\build_win.cmd

I have got the folllowing error: 我有以下错误:

    CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
    CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
    CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
    -- Configuring incomplete, errors occurred!
    See also "C:/Project_git/caffe/scripts/build/CMakeFiles/CMakeOutput.log".
    ERROR: Configure failed

I downloaded Ninja, but not sure what to do with it. 我下载了Ninja,但不确定如何处理。 So I tried to change WITH_NINJA=1 to WITH_NINJA=0, then I have got the following error 所以我试图将WITH_NINJA = 1更改为WITH_NINJA = 0,然后出现以下错误

    -- The C compiler identification is MSVC 19.0.24215.1
    -- The CXX compiler identification is MSVC 19.0.24215.1
    -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
    -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
    -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Found PythonInterp: C:/Python34/python.exe (found suitable version "3.4.3", minimum required is "2.7")
    CMake Error at cmake/WindowsDownloadPrebuiltDependencies.cmake:29 (message):
      Could not find url for MSVC version = 1900 and Python version = 3.4.
     Call Stack (most recent call first):
      CMakeLists.txt:75 (include)
     -- Configuring incomplete, errors occurred!
    See also C:/Project_git/caffe/scripts/build/CMakeFiles/CMakeOutput.log".
    ERROR: Configure failed

Please let me know what should be my next step! 请让我知道下一步该怎么做! Thanks in advance! 提前致谢!

Step #1 第1步

Open build_win.cmd in notepad++ and update file line as below (to diable Ninja build) 在记事本++中打开build_win.cmd并按如下所示更新文件行(以禁用Ninja构建)

:: Change to 1 to use Ninja generator (builds much faster)
if NOT DEFINED WITH_NINJA set WITH_NINJA=0

I am using Microsoft Visual Studio 2013 我正在使用Microsoft Visual Studio 2013

:: Change MSVC_VERSION to 12 to use VS 2013
if NOT DEFINED MSVC_VERSION set MSVC_VERSION=12

Step # 2 第2步

Open build folder which is inside the caffe folder and delete all previously generated files. 打开caffe文件夹内的build文件夹,然后删除所有以前生成的文件。

Step # 3 步骤#3

Python 3.6 is not supported officially and python 3.5 has some challenging issues. 正式不支持Python 3.6,而Python 3.5存在一些具有挑战性的问题。 For a beginner i would recommend to install python 2.7 straight forward. 对于初学者,我建议直接安装python 2.7。

Install anaconda 2.7 [Anaconda  2.7][1]

Step # 4 第四步

Execute scripts/build_win.cmd
[1]: https://www.continuum.io/downloads

Reformat the code for easy to read 重新格式化代码以便于阅读

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM