/build/include\caffe/proto/caffe.pb.h(4356):错误:在Windows

时间:2017-09-16 18:07:21

标签: caffe

我正在尝试将Caffe-SSD移植到Windows。我将所有新文件(图层和诸如此类)移动到Caffe's latest windows branch并使用了Caffe_SSD caffe.proto文件并启动了编译过程。 似乎一切都已到位,但经过几分钟的编译后,它就失败了:

"C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj" (default target) (3) ->
(CustomBuild target) ->
  C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/include\caffe/proto/caffe.pb.h(4356): error : expected an ident
ifier [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/include\caffe/proto/caffe.pb.h(14835): error : expected an iden
tifier [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]

    414 Warning(s)
    2 Error(s)

Time Elapsed 00:08:49.15
ERROR: Build failed

为什么我收到此错误?我使用了ssd分支中的caffe.proto,因此一切都很好!问题在哪里?
顺便说一下,这是配置:

 C:\Users\Master\Desktop\Caffe\caffe-windows-ssd>scripts\build_win.cmd
The system cannot find the drive specified.
The system cannot find the drive specified.
INFO: ============================================================
INFO: Summary:
INFO: ============================================================
INFO: MSVC_VERSION               = 14
INFO: WITH_NINJA                 = 0
INFO: CMAKE_GENERATOR            = "Visual Studio 14 2015 Win64"
INFO: CPU_ONLY                   = 0
INFO: CUDA_ARCH_NAME             = Auto
INFO: CMAKE_CONFIG               = Release
INFO: USE_NCCL                   = 0
INFO: CMAKE_BUILD_SHARED_LIBS    = 0
INFO: PYTHON_VERSION             = 3
INFO: BUILD_PYTHON               = 1
INFO: BUILD_PYTHON_LAYER         = 1
INFO: BUILD_MATLAB               = 0
INFO: PYTHON_EXE                 = "python"
INFO: RUN_TESTS                  = 0
INFO: RUN_LINT                   = 0
INFO: RUN_INSTALL                = 1
INFO: ============================================================
-- 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:/Users/Master/Anaconda3/envs/anaconda35/python.exe (found suitable version "3.5.3", minimum required is "2.7")
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Boost version: 1.61.0
-- Found the following Boost libraries:
--   system
--   thread
--   filesystem
--   chrono
--   date_time
--   atomic
-- Found GFlags: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include
-- Found gflags  (include: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include, library: gflags_shared)
-- Found Glog: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include
-- Found glog    (include: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include, library: glog)
-- Found Protobuf: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/bin/protoc.exe (found version "3.1.0")
-- Found PROTOBUF Compiler: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/bin/protoc.exe
-- Found LMDB: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include
-- Found lmdb    (include: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include, library: lmdb)
-- Found LevelDB: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include
-- Found LevelDB (include: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include, library: leveldb)
-- Found ZLIB: optimized;C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/lib/caffezlib.lib;debug;C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/lib/caffezlibd.lib (found version "1.2.8")
-- Found Snappy: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include
-- Found Snappy  (include: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include, library: snappy_static;optimized;C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/lib/caffezlib.lib;debug;C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/lib/caffezlibd.lib)
-- CUDA detected: 8.0
-- Found cuDNN: ver. 6.0.20 found (include: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/cuda60/cuda/include, library: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/cuda60/cuda/lib/x64/cudnn.lib)
-- Added CUDA NVCC flags for: sm_61
-- OpenCV found (C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries)
-- Found OpenBLAS libraries: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/lib/libopenblas.dll.a
-- Found OpenBLAS include: C:/Users/Master/.caffe/dependencies/libraries_v140_x64_py35_1.1.0/libraries/include
-- Found PythonLibs: C:/Users/Master/Anaconda3/envs/anaconda35/libs/python35.lib (found suitable version "3.5.3", minimum required is "2.7")
-- Found NumPy: C:/Users/Master/Anaconda3/envs/anaconda35/lib/site-packages/numpy/core/include (found suitable version "1.13.1", minimum required is "1.7.1")
-- NumPy ver. 1.13.1 found (include: C:/Users/Master/Anaconda3/envs/anaconda35/lib/site-packages/numpy/core/include)
-- Boost version: 1.61.0
-- Found the following Boost libraries:
--   python
-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.10.1.windows.1")
--
-- ******************* Caffe Configuration Summary *******************
-- General:
--   Version           :   1.0.0
--   Git               :   unknown
--   System            :   Windows
--   C++ compiler      :   C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
--   Release CXX flags :   /MD /O2 /Ob2 /DNDEBUG /DWIN32 /D_WINDOWS /W3 /GR /EHsc
--   Debug CXX flags   :   /MDd /Zi /Ob0 /Od /RTC1 /DWIN32 /D_WINDOWS /W3 /GR /EHsc
--   Build type        :   Release
--
--   BUILD_SHARED_LIBS :   0
--   BUILD_python      :   1
--   BUILD_matlab      :   0
--   BUILD_docs        :
--   CPU_ONLY          :   0
--   USE_OPENCV        :   ON
--   USE_LEVELDB       :   ON
--   USE_LMDB          :   ON
--   USE_NCCL          :   0
--   ALLOW_LMDB_NOLOCK :   OFF
--
-- Dependencies:
--   BLAS              :   Yes (Open)
--   Boost             :   Yes (ver. 1.61)
--   glog              :   Yes
--   gflags            :   Yes
--   protobuf          :   Yes (ver. 3.1.0)
--   lmdb              :   Yes (ver. 0.9.70)
--   LevelDB           :   Yes (ver. 1.18)
--   Snappy            :   Yes (ver. 1.1.1)
--   OpenCV            :   Yes (ver. 3.1.0)
--   CUDA              :   Yes (ver. 8.0)
--
-- NVIDIA CUDA:
--   Target GPU(s)     :   Auto
--   GPU arch(s)       :   sm_61
--   cuDNN             :   Yes (ver. 6.0.20)
--
-- Python:
--   Interpreter       :   C:/Users/Master/Anaconda3/envs/anaconda35/python.exe (ver. 3.5.3)
--   Libraries         :   C:/Users/Master/Anaconda3/envs/anaconda35/libs/python35.lib (ver 3.5.3)
--   NumPy             :   C:/Users/Master/Anaconda3/envs/anaconda35/lib/site-packages/numpy/core/include (ver 1.13.1)
--
-- Install:
--   Install path      :   C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/install
--
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 9/16/2017 10:12:06 PM.
Project "C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\ALL_BUILD.vcxproj" on node 1 (default targets).
Project "C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\ALL_BUILD.vcxproj" (1) is building "C:\Users\Master\Desk
top\Caffe\caffe-windows-ssd\build\ZERO_CHECK.vcxproj" (2) on node 1 (default targets).
PrepareForBuild:
  Creating directory "x64\Release\ZERO_CHECK\".
  Creating directory "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\".
InitializeBuildStatus:
  Creating "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
CustomBuild:
  Checking Build System
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/CMakeFiles/generate.stamp
   is up-to-date.
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/src/gtest/CMakeFiles/gene
  rate.stamp is up-to-date.
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/src/caffe/CMakeFiles/gene
  rate.stamp is up-to-date.
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/src/caffe/test/CMakeFiles
  /generate.stamp is up-to-date.
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/tools/CMakeFiles/generate
  .stamp is up-to-date.
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/examples/CMakeFiles/gener
  ate.stamp is up-to-date.
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/python/CMakeFiles/generat
  e.stamp is up-to-date.
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/matlab/CMakeFiles/generat
  e.stamp is up-to-date.
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/docs/CMakeFiles/generate.
  stamp is up-to-date.
FinalizeBuildStatus:
  Deleting file "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
  Touching "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
Done Building Project "C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\ZERO_CHECK.vcxproj" (default targets).

Project "C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\ALL_BUILD.vcxproj" (1) is building "C:\Users\Master\Desk
top\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj" (3) on node 1 (default targets).
Project "C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj" (3) is building "C:\Users\Maste
r\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffeproto.vcxproj" (4) on node 1 (default targets).
PrepareForBuild:
  Creating directory "caffeproto.dir\Release\".
  Creating directory "C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\lib\Release\".
  Creating directory "caffeproto.dir\Release\caffeproto.tlog\".
InitializeBuildStatus:
  Creating "caffeproto.dir\Release\caffeproto.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ComputeCustomBuildOutput:
  Creating directory "C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\include\caffe\proto\".
CustomBuild:
  Building Custom Rule C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/src/caffe/CMakeLists.txt
  CMake does not need to re-run because C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/build/src/caffe/CMakeFiles/gene
  rate.stamp is up-to-date.
  Running C++/Python protocol buffer compiler on C:/Users/Master/Desktop/Caffe/caffe-windows-ssd/src/caffe/proto/caffe.
  proto
ClCompile:
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\CL.exe /c /I"C:\Users\Master\Desktop\Caffe\caffe
  -windows-ssd\build\include" /I"C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build" /IC:\Users\Master\.caffe\depend
  encies\libraries_v140_x64_py35_1.1.0\libraries\include /nologo /W3 /WX- /O2 /Ob2 /D WIN32 /D _WINDOWS /D NDEBUG /D CA
  FFE_VERSION=1.0.0 /D "CMAKE_INTDIR=\"Release\"" /D _MBCS /Gm- /EHsc /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:
  inline /GR /Fo"caffeproto.dir\Release\\" /Fd"caffeproto.dir\Release\caffeproto.pdb" /Gd /TP /errorReport:queue "C:\Us
  ers\Master\Desktop\Caffe\caffe-windows-ssd\build\include\caffe\proto\caffe.pb.cc"
  caffe.pb.cc

这是caffe.pb.h第4356行的内容:

  // nested types ----------------------------------------------------

  typedef ParamSpec_DimCheckMode DimCheckMode;
  static const DimCheckMode STRICT =
    ParamSpec_DimCheckMode_STRICT;
  static const DimCheckMode PERMISSIVE =
    ParamSpec_DimCheckMode_PERMISSIVE;
  static inline bool DimCheckMode_IsValid(int value) {
    return ParamSpec_DimCheckMode_IsValid(value);
  }
  static const DimCheckMode DimCheckMode_MIN =
    ParamSpec_DimCheckMode_DimCheckMode_MIN;
  static const DimCheckMode DimCheckMode_MAX =
    ParamSpec_DimCheckMode_DimCheckMode_MAX;
  static const int DimCheckMode_ARRAYSIZE =
    ParamSpec_DimCheckMode_DimCheckMode_ARRAYSIZE;
  static inline const ::google::protobuf::EnumDescriptor*
  DimCheckMode_descriptor() {
    return ParamSpec_DimCheckMode_descriptor();
  }
  static inline const ::std::string& DimCheckMode_Name(DimCheckMode value) {
    return ParamSpec_DimCheckMode_Name(value);
  }
  static inline bool DimCheckMode_Parse(const ::std::string& name,
      DimCheckMode* value) {
    return ParamSpec_DimCheckMode_Parse(name, value);
  }

和第14835行:

 typedef V1LayerParameter_DimCheckMode DimCheckMode;
  static const DimCheckMode STRICT =
    V1LayerParameter_DimCheckMode_STRICT;
  static const DimCheckMode PERMISSIVE =
    V1LayerParameter_DimCheckMode_PERMISSIVE;
  static inline bool DimCheckMode_IsValid(int value) {
    return V1LayerParameter_DimCheckMode_IsValid(value);
  }
  static const DimCheckMode DimCheckMode_MIN =
    V1LayerParameter_DimCheckMode_DimCheckMode_MIN;
  static const DimCheckMode DimCheckMode_MAX =
    V1LayerParameter_DimCheckMode_DimCheckMode_MAX;
  static const int DimCheckMode_ARRAYSIZE =
    V1LayerParameter_DimCheckMode_DimCheckMode_ARRAYSIZE;
  static inline const ::google::protobuf::EnumDescriptor*
  DimCheckMode_descriptor() {
    return V1LayerParameter_DimCheckMode_descriptor();
  }
  static inline const ::std::string& DimCheckMode_Name(DimCheckMode value) {
    return V1LayerParameter_DimCheckMode_Name(value);
  }
  static inline bool DimCheckMode_Parse(const ::std::string& name,
      DimCheckMode* value) {
    return V1LayerParameter_DimCheckMode_Parse(name, value);
  }

如果需要完整的编译日志,则完整的日志为here
这是我使用的caffe.proto的内容(从linux ssd复制) Caffe.proto From caffe_ssd_linux
Caffe.proto From caffe-windows

更新2:

STRICT替换为_STRICT而将PERMISSIVE替换为_PERMISSIVE会导致以下错误:

"C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj" (default target) (3) ->
(ClCompile target) ->
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(59): error C2039: 'PREFETCH_COUNT': is not a member of 'caffe::AnnotatedDataLayer<fl
oat>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(60): error C2039: 'data_': is not a member of 'boost::shared_ptr<caffe::Batch<Dtype>
>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(60): error C2228: left of '.Reshape' must have class/struct/union [C:\Users\Master\D
esktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(104): error C2039: 'PREFETCH_COUNT': is not a member of 'caffe::AnnotatedDataLayer<f
loat>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(105): error C2039: 'label_': is not a member of 'boost::shared_ptr<caffe::Batch<Dtyp
e>>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(105): error C2228: left of '.Reshape' must have class/struct/union [C:\Users\Master\
Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(157): error C2039: 'DistortImage': is not a member of 'caffe::DataTransformer<Dtype>
' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(161): error C2039: 'ExpandImage': is not a member of 'caffe::DataTransformer<Dtype>'
 [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(168): error C2039: 'ExpandImage': is not a member of 'caffe::DataTransformer<Dtype>'
 [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(183): error C2039: 'CropImage': is not a member of 'caffe::DataTransformer<Dtype>' [
C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(229): error C2661: 'caffe::DataTransformer<Dtype>::Transform': no overloaded functio
n takes 3 arguments [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(59): error C2039: 'PREFETCH_COUNT': is not a member of 'caffe::AnnotatedDataLayer<do
uble>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(60): error C2039: 'data_': is not a member of 'boost::shared_ptr<caffe::Batch<Dtype>
>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(104): error C2039: 'PREFETCH_COUNT': is not a member of 'caffe::AnnotatedDataLayer<d
ouble>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(105): error C2039: 'label_': is not a member of 'boost::shared_ptr<caffe::Batch<Dtyp
e>>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(157): error C2039: 'DistortImage': is not a member of 'caffe::DataTransformer<Dtype>
' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(161): error C2039: 'ExpandImage': is not a member of 'caffe::DataTransformer<Dtype>'
 [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(168): error C2039: 'ExpandImage': is not a member of 'caffe::DataTransformer<Dtype>'
 [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(183): error C2039: 'CropImage': is not a member of 'caffe::DataTransformer<Dtype>' [
C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\annotated_data_layer.cpp(229): error C2661: 'caffe::DataTransformer<Dtype>::Transform': no overloaded functio
n takes 3 arguments [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\detection_output_layer.cpp(65): error C3861: 'MapLabelToName': identifier not found [C:\Users\Master\Desktop\
Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\detection_output_layer.cpp(67): error C3861: 'MapLabelToDisplayName': identifier not found [C:\Users\Master\D
esktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\detection_output_layer.cpp(462): error C2039: 'TransformInv': is not a member of 'caffe::DataTransformer<Dtyp
e>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\detection_output_layer.cpp(462): error C2039: 'TransformInv': is not a member of 'caffe::DataTransformer<Dtyp
e>' [C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\infogain_loss_layer.cpp(18): error C2039: 'axis': is not a member of 'caffe::InfogainLossParameter' [C:\Users
\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\infogain_loss_layer.cpp(57): error C2039: 'axis': is not a member of 'caffe::InfogainLossParameter' [C:\Users
\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(243): error C2039: 'GetNormalizer': is not a member of 'caffe::LossLayer<Dtype>' [C:\
Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(243): error C3861: 'GetNormalizer': identifier not found [C:\Users\Master\Desktop\Caf
fe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(249): error C2039: 'GetNormalizer': is not a member of 'caffe::LossLayer<Dtype>' [C:\
Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(249): error C3861: 'GetNormalizer': identifier not found [C:\Users\Master\Desktop\Caf
fe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(281): error C2039: 'GetNormalizer': is not a member of 'caffe::LossLayer<Dtype>' [C:\
Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(281): error C3861: 'GetNormalizer': identifier not found [C:\Users\Master\Desktop\Caf
fe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(322): error C2039: 'GetNormalizer': is not a member of 'caffe::LossLayer<Dtype>' [C:\
Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(322): error C3861: 'GetNormalizer': identifier not found [C:\Users\Master\Desktop\Caf
fe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(243): error C2039: 'GetNormalizer': is not a member of 'caffe::LossLayer<Dtype>' [C:\
Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(249): error C2039: 'GetNormalizer': is not a member of 'caffe::LossLayer<Dtype>' [C:\
Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(281): error C2039: 'GetNormalizer': is not a member of 'caffe::LossLayer<Dtype>' [C:\
Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\multibox_loss_layer.cpp(322): error C2039: 'GetNormalizer': is not a member of 'caffe::LossLayer<Dtype>' [C:\
Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(70): error C2039: 'PREFETCH_COUNT': is not a member of 'caffe::VideoDataLayer<float>' [C
:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(71): error C2039: 'data_': is not a member of 'boost::shared_ptr<caffe::Batch<Dtype>>' [
C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(71): error C2228: left of '.Reshape' must have class/struct/union [C:\Users\Master\Deskt
op\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(80): error C2039: 'PREFETCH_COUNT': is not a member of 'caffe::VideoDataLayer<float>' [C
:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(81): error C2039: 'label_': is not a member of 'boost::shared_ptr<caffe::Batch<Dtype>>'
[C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(81): error C2228: left of '.Reshape' must have class/struct/union [C:\Users\Master\Deskt
op\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(70): error C2039: 'PREFETCH_COUNT': is not a member of 'caffe::VideoDataLayer<double>' [
C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(71): error C2039: 'data_': is not a member of 'boost::shared_ptr<caffe::Batch<Dtype>>' [
C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(80): error C2039: 'PREFETCH_COUNT': is not a member of 'caffe::VideoDataLayer<double>' [
C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]
  C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\src\caffe\layers\video_data_layer.cpp(81): error C2039: 'label_': is not a member of 'boost::shared_ptr<caffe::Batch<Dtype>>'
[C:\Users\Master\Desktop\Caffe\caffe-windows-ssd\build\src\caffe\caffe.vcxproj]

    1618 Warning(s)
    48 Error(s)

Time Elapsed 00:12:50.35
ERROR: Build failed

1 个答案:

答案 0 :(得分:1)

我遇到了您在 Update 2 中遇到的问题,并且通过运气和谷歌搜索可以解决这些问题。所以这里是受苦的人,

我在GitHub上发现了this个线程,说,

    PREFETCH_COUNT下每个令人烦恼的cpp文件中,
  • prefetch_.size()应该更改为<CAFFE_DIR>\caffe\src\caffe\layers。在您的情况下,它们应该为annotated_data_layer.cppvideo_data_layer.cpp

  • this->prefetch_[i].下每个令人烦恼的cpp文件中,
  • this->prefetch_[i]->应该更改为<CAFFE_DIR>\caffe\src\caffe\layers。在您的情况下,它们应该为annotated_data_layer.cppvideo_data_layer.cpp。这将解决与label_': is not a memberdata_': is not a memberleft of '.Reshape' must have class/struct/union

  • 相关的错误
  • 对于infogain_loss_layer.cpp(18): error C2039: 'axis': is not a member of caffe::InfogainLossParameter错误,您需要在axis文件中的InfogainLossParameter消息中添加caffe.proto。在我的情况下,上次使用的ID是1,因此我将其添加为optional int32 axis = 2;现在InfogainLossParameter消息如下,

message InfogainLossParameter {
  // Specify the infogain matrix source.
  optional string source = 1;
  optional int32 axis = 2;
}

遗憾的是,我认为这不会解决您的所有问题,与DataTransformer相关的问题将保留,但我希望它可以帮助某人解决其中的一些问题而无需花费我太多的时间。