I have been trying to compile caffe2 on a windows 10 system with cuda for the past week. The library is clearly not ready for windows release as there were many problem during the installation.
After various tweaking on CMake and running in on git bash window, I was finally able to get some progress and start building the library until I came across this problem.
"D:\Projects\Caffe2\caffe2\build\caffe2\caffe2_gpu.vcxproj"(▒⺻ ▒▒▒)(16)->
(CustomBuild ▒▒▒) ->
D:/Projects/Caffe2/caffe2/build\caffe2/proto/caffe2.pb.h(227): error : member "caffe2::TensorProto_Segment::kIndexInFileMessages" may not be initialized [D:\Projects\Caffe2\caffe2\build\caffe2\caffe2_gpu.vcxproj]
D:/Projects/Caffe2/caffe2/build\caffe2/proto/caffe2.pb.h(349): error : member "caffe2::TensorProto::kIndexInFileMessages" may not be initialized [D:\Projects\Caffe2\caffe2\build\caffe2\caffe2_gpu.vcxproj]
D:/Projects/Caffe2/caffe2/build\caffe2/proto/caffe2.pb.h(660): error : member "caffe2::QTensorProto::kIndexInFileMessages" may not be initialized [D:\Projects\Caffe2\caffe2\build\caffe2\caffe2_gpu.vcxproj]
D:/Projects/Caffe2/caffe2/build\caffe2/proto/caffe2.pb.h(847): error : member "caffe2::TensorProtos::kIndexInFileMessages" may not be initialized [D:\Projects\Caffe2\caffe2\build\caffe2\caffe2_gpu.vcxproj]
D:/Projects/Caffe2/caffe2/build\caffe2/proto/caffe2.pb.h(959): error : member "caffe2::TensorShape::kIndexInFileMessages" may not be initialized [D:\Projects\Caffe2\caffe2\build\caffe2\caffe2_gpu.vcxproj]
D:/Projects/Caffe2/caffe2/build\caffe2/proto/caffe2.pb.h(1122): error : member "caffe2::TensorShapes::kIndexInFileMessages" may not be initialized [D:\Projects\Caffe2\caffe2\build\caffe2\caffe2_gpu.vcxproj]
D:/Projects/Caffe2/caffe2/build\caffe2/proto/caffe2.pb.h(1234): error : member "caffe2::Argument::kIndexInFileMessages" may not be initialized [D:\Projects\Caffe2\caffe2\build\caffe2\caffe2_gpu.vcxproj]
D:/Projects/Caffe2/caffe2/build\caffe2/proto/caffe2.pb.h(1463): error : member "caffe2::DeviceOption::kIndexInFileMessages" may not be initialized [D:\Projects\Caffe2\caffe2\build\caffe2\caffe2_gpu.vcxproj]
D:/Projects/Caffe2/caffe2/build\caffe2/proto/caffe2.pb.h(1620): error : member "caffe2::OperatorDef::kIndexInFileMessages" may not be initialized [D:\Projects\Caffe2\caffe2\build\caffe2\caffe2_gpu.vcxproj]
D:/Projects/Caffe2/caffe2/build\caffe2/proto/caffe2.pb.h(1895): error : member "caffe2::NetDef::kIndexInFileMessages" may not be initialized [D:\Projects\Caffe2\caffe2\build\caffe2\caffe2_gpu.vcxproj]
D:/Projects/Caffe2/caffe2/build\caffe2/proto/caffe2.pb.h(2124): error : member "caffe2::ExecutionStep::kIndexInFileMessages" may not be initialized [D:\Projects\Caffe2\caffe2\build\caffe2\caffe2_gpu.vcxproj]
D:/Projects/Caffe2/caffe2/build\caffe2/proto/caffe2.pb.h(2401): error : member "caffe2::PlanDef::kIndexInFileMessages" may not be initialized [D:\Projects\Caffe2\caffe2\build\caffe2\caffe2_gpu.vcxproj]
D:/Projects/Caffe2/caffe2/build\caffe2/proto/caffe2.pb.h(2544): error : member "caffe2::BlobProto::kIndexInFileMessages" may not be initialized [D:\Projects\Caffe2\caffe2\build\caffe2\caffe2_gpu.vcxproj]
D:/Projects/Caffe2/caffe2/build\caffe2/proto/caffe2.pb.h(2741): error : member "caffe2::DBReaderProto::kIndexInFileMessages" may not be initialized [D:\Projects\Caffe2\caffe2\build\caffe2\caffe2_gpu.vcxproj]
What is causing the error "::kIndexInFileMessages" may not be initialized" ? I have check the piece of code in question and i don't see any thing off in particular. The values is initiated in the caffe2.pb.h file.
static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const TensorProto_Segment* internal_default_instance() {
return reinterpret_cast<const TensorProto_Segment*>(
&_TensorProto_Segment_default_instance_);
}
static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 0;
This is a summary of my build settings:
-- ******** Summary ********
-- General:
-- CMake version : 3.11.0
-- CMake command : C:/Program Files (x86)/CMake/bin/cmake.exe
-- Git version : v0.8.1-1500-g0dd328452-dirty
-- System : Windows
-- C++ compiler : C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
-- C++ compiler version : 19.0.24215.1
-- BLAS : Eigen
-- CXX flags : /DWIN32 /D_WINDOWS /W3 /GR /EHsc -DONNX_NAMESPACE=onnx_c2 /MP /bigobj
-- Build type : Release
-- Compile definitions : PROTOBUF_USE_DLLS
--
-- BUILD_BINARY : ON
-- BUILD_CUSTOM_PROTOBUF : OFF
-- Protobuf compiler : Protobuf_PROTOC_EXECUTABLE-NOTFOUND
-- Protobuf includes :
-- Protobuf libraries : Protobuf_LIBRARY-NOTFOUND
-- BUILD_DOCS : OFF
-- BUILD_PYTHON : ON
-- Python version : 2.7.14
-- Python includes : C:/Python27/include
-- BUILD_SHARED_LIBS : ON
-- BUILD_TEST : OFF
-- USE_ATEN : OFF
-- USE_ASAN : OFF
-- USE_CUDA : ON
-- CUDA version : 9.1
-- CuDNN version : 7.1.2
-- CUDA root directory : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.1
-- CUDA library : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.1/lib/x64/cuda.lib
-- CUDA NVRTC library : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.1/lib/x64/nvrtc.lib
-- CUDA runtime library: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.1/lib/x64/cudart.lib
-- CUDA include path : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.1/include
-- NVCC executable : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.1/bin/nvcc.exe
-- CUDA host compiler : $(VCInstallDir)bin
-- USE_EIGEN_FOR_BLAS : 1
-- USE_FFMPEG : OFF
-- USE_GFLAGS : OFF
-- USE_GLOG : OFF
-- USE_GLOO : OFF
-- USE_LEVELDB : OFF
-- USE_LITE_PROTO : OFF
-- USE_LMDB : OFF
-- USE_METAL : OFF
-- USE_MKL :
-- USE_MOBILE_OPENGL : OFF
-- USE_MPI : OFF
-- USE_NCCL : OFF
-- USE_NERVANA_GPU : OFF
-- USE_NNPACK : OFF
-- USE_OBSERVERS : ON
-- USE_OPENCV : OFF
-- USE_OPENMP : OFF
-- USE_PROF : OFF
-- USE_REDIS : OFF
-- USE_ROCKSDB : OFF
-- USE_ZMQ : OFF
-- Configuring done
BUILD_CUSTOM_PROTOBUF is turned off so that it can build the protobuf library that came along with caffe2 source files.