pythoncmakecaffe2

How to build/install caffe2 in windows?


I have tried setting up caffe2 in windows 10 by cloning the pytorch repo and trying to build from source since binaries are not available for windows platform.

But whenever I run the build_windows.bat file in pytorch/scripts, I end up getting the error

CMake Error at cmake/Codegen.cmake:163 (message):
  Failed to get generated_cpp list
  Call Stack (most recent call first):
    caffe2/CMakeLists.txt:2 (include)
-- Configuring incomplete, errors occurred!

Python - 2.7.13

CMake - 3.13.4

CUDA - 10.0

I was following the instructions here. But the build fails after couple of minutes after starting when BUILD_PYTHON is set to ON.

Any help on this would be highly appreciated.


Solution

  • I had the same problem, then I realized it was caused by cmake configuration. Maybe it points to a wrong python interpreter.

    You could try to open the build_windows.bat, edit the '-DPYTHON_EXECUTABLE' (should in line 85) to the absolute directory of your python.exe (It will look like '-DPYTHON_EXECUTABLE="E:\python\python.exe"' after edition) and run it again. Hope this help!