facebookarchive / caffe2

Caffe2 is a lightweight, modular, and scalable deep learning framework.
https://caffe2.ai
Apache License 2.0
8.42k stars 1.95k forks source link

incompatible 32-bit atomic layout #290

Closed hlzz closed 7 years ago

hlzz commented 7 years ago

I built the project on Mac 10.12 with xcode 8.2. The cmake info is the following:

-- The CXX compiler identification is AppleClang 8.0.0.8000042 -- The C compiler identification is AppleClang 8.0.0.8000042 -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Found Git: /usr/bin/git (found version "2.10.1 (Apple Git-78)") Submodule 'third_party/NNPACK' (https://github.com/Maratyszcza/NNPACK.git) registered for path 'build/third_party/NNPACK' Submodule 'third_party/NNPACK_deps/FP16' (https://github.com/Maratyszcza/FP16.git) registered for path 'build/third_party/NNPACK_deps/FP16' Submodule 'third_party/NNPACK_deps/FXdiv' (https://github.com/Maratyszcza/FXdiv.git) registered for path 'build/third_party/NNPACK_deps/FXdiv' Submodule 'third_party/NNPACK_deps/psimd' (https://github.com/Maratyszcza/psimd.git) registered for path 'build/third_party/NNPACK_deps/psimd' Submodule 'third_party/NNPACK_deps/pthreadpool' (https://github.com/Maratyszcza/pthreadpool.git) registered for path 'build/third_party/NNPACK_deps/pthreadpool' Submodule 'third_party/android-cmake' (https://github.com/taka-no-me/android-cmake.git) registered for path 'build/third_party/android-cmake' Submodule 'third_party/benchmark' (https://github.com/google/benchmark.git) registered for path 'build/third_party/benchmark' Submodule 'third_party/cnmem' (https://github.com/nvidia/cnmem.git) registered for path 'build/third_party/cnmem' Submodule 'third_party/cub' (https://github.com/NVlabs/cub.git) registered for path 'build/third_party/cub' Submodule 'third_party/eigen' (https://github.com/RLovelett/eigen.git) registered for path 'build/third_party/eigen' Submodule 'third_party/gloo' (https://github.com/facebookincubator/gloo) registered for path 'build/third_party/gloo' Submodule 'third_party/googletest' (https://github.com/google/googletest.git) registered for path 'build/third_party/googletest' Submodule 'third_party/ios-cmake' (https://github.com/Yangqing/ios-cmake.git) registered for path 'build/third_party/ios-cmake' Submodule 'third_party/nccl' (https://github.com/nvidia/nccl.git) registered for path 'build/third_party/nccl' Submodule 'third_party/nervanagpu' (https://github.com/NervanaSystems/nervanagpu.git) registered for path 'build/third_party/nervanagpu' Submodule 'third_party/protobuf' (https://github.com/google/protobuf.git) registered for path 'build/third_party/protobuf' Submodule 'third_party/pybind11' (https://github.com/pybind/pybind11.git) registered for path 'build/third_party/pybind11' Cloning into '/Users/STW/Documents/Projects/caffe2/third_party/NNPACK'... Cloning into '/Users/STW/Documents/Projects/caffe2/third_party/NNPACK_deps/FP16'... Cloning into '/Users/STW/Documents/Projects/caffe2/third_party/NNPACK_deps/FXdiv'... Cloning into '/Users/STW/Documents/Projects/caffe2/third_party/NNPACK_deps/psimd'... Cloning into '/Users/STW/Documents/Projects/caffe2/third_party/NNPACK_deps/pthreadpool'... Cloning into '/Users/STW/Documents/Projects/caffe2/third_party/android-cmake'... Cloning into '/Users/STW/Documents/Projects/caffe2/third_party/benchmark'... Cloning into '/Users/STW/Documents/Projects/caffe2/third_party/cnmem'... Cloning into '/Users/STW/Documents/Projects/caffe2/third_party/cub'... Cloning into '/Users/STW/Documents/Projects/caffe2/third_party/eigen'... Cloning into '/Users/STW/Documents/Projects/caffe2/third_party/gloo'... Cloning into '/Users/STW/Documents/Projects/caffe2/third_party/googletest'... Cloning into '/Users/STW/Documents/Projects/caffe2/third_party/ios-cmake'... Cloning into '/Users/STW/Documents/Projects/caffe2/third_party/nccl'... Cloning into '/Users/STW/Documents/Projects/caffe2/third_party/nervanagpu'... Cloning into '/Users/STW/Documents/Projects/caffe2/third_party/protobuf'... Cloning into '/Users/STW/Documents/Projects/caffe2/third_party/pybind11'... Submodule path '../third_party/NNPACK': checked out '02bfa475d64040cd72b7c01daa9e862523ae87da' Submodule path '../third_party/NNPACK_deps/FP16': checked out '2e9eeeb0b463736d13b887d790ac7e72e78fa4bc' Submodule path '../third_party/NNPACK_deps/FXdiv': checked out '8f85044fb41e560508cd69ed26c9afb9cc120e8a' Submodule path '../third_party/NNPACK_deps/psimd': checked out '0b26a3fb98dd6af7e1f4e0796c56df6b32b1c016' Submodule path '../third_party/NNPACK_deps/pthreadpool': checked out '9e17903a3fc963fe86b151aaddae7cf1b1d34815' Submodule path '../third_party/android-cmake': checked out '556cc14296c226f753a3778d99d8b60778b7df4f' Submodule path '../third_party/benchmark': checked out '4bf28e611b55de8a2d4eece3c335e014f8b0f630' Submodule path '../third_party/cnmem': checked out '28a182d49529da49f4ac4e3941cec3edf16b3540' Submodule path '../third_party/cub': checked out '89de7ab20167909bc2c4f8acd397671c47cf3c0d' Submodule path '../third_party/eigen': checked out 'ae9889a130bd0a9d3007f41d015563c2e8ac605f' Submodule path '../third_party/gloo': checked out 'f67ab32d3439061946ce2c1bed8baa0e1b5d367f' Submodule path '../third_party/googletest': checked out '5e7fd50e17b6edf1cadff973d0ec68966cf3265e' Submodule path '../third_party/ios-cmake': checked out 'e3a7695d1d68ef4eca716031f94e8475b1589b1f' Submodule path '../third_party/nccl': checked out '2a974f5ca2aa12b178046b2206b43f1fd69d9fae' Submodule path '../third_party/nervanagpu': checked out 'd4eefd50fbd7d34a17dddbc829888835d67b5f4a' Submodule path '../third_party/protobuf': checked out 'a428e42072765993ff674fda72863c9f1aa2d268' Submodule path '../third_party/pybind11': checked out 'f38f359f96815421f1780c1a676715efd041f1ae' -- Build type not set - defaulting to Release -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - found -- Found Threads: TRUE
-- Found Protobuf: /usr/local/lib/libprotobuf.dylib (found version "3.2.0") -- The BLAS backend of choice:Eigen -- Could NOT find NNPACK (missing: NNPACK_INCLUDE_DIR NNPACK_LIBRARY) -- Will try to build NNPACK from source. If anything fails, follow the NNPACK prerequisite installation steps. CMake Warning at cmake/External/nnpack.cmake:157 (message): NNPACK is chosen to be installed, but confu and ninja that are needed by it are not installed. As a result we won't build with NNPACK. Call Stack (most recent call first): cmake/Dependencies.cmake:52 (include) CMakeLists.txt:85 (include)

CMake Warning at cmake/Dependencies.cmake:57 (message): Not compiling with NNPACK. Suppress this warning with -DUSE_NNPACK=OFF Call Stack (most recent call first): CMakeLists.txt:85 (include)

-- Found GFlags: /usr/local/include
-- Found gflags (include: /usr/local/include, library: /usr/local/lib/libgflags.dylib) -- Found system gflags install. -- Found Glog: /usr/local/include
-- Found glog (include: /usr/local/include, library: /usr/local/lib/libglog.dylib) -- Found system glog install. -- Found PythonInterp: /usr/local/bin/python (found version "2.7.13") -- git Version: v0.0.0 -- Version: 0.0.0 -- Performing Test HAVE_CXX_FLAG_STD_CXX11 -- Performing Test HAVE_CXX_FLAG_STD_CXX11 - Success -- Performing Test HAVE_CXX_FLAG_WALL -- Performing Test HAVE_CXX_FLAG_WALL - Success -- Performing Test HAVE_CXX_FLAG_WEXTRA -- Performing Test HAVE_CXX_FLAG_WEXTRA - Success -- Performing Test HAVE_CXX_FLAG_WSHADOW -- Performing Test HAVE_CXX_FLAG_WSHADOW - Success -- Performing Test HAVE_CXX_FLAG_WERROR -- Performing Test HAVE_CXX_FLAG_WERROR - Success -- Performing Test HAVE_CXX_FLAG_PEDANTIC -- Performing Test HAVE_CXX_FLAG_PEDANTIC - Success -- Performing Test HAVE_CXX_FLAG_PEDANTIC_ERRORS -- Performing Test HAVE_CXX_FLAG_PEDANTIC_ERRORS - Success -- Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32 -- Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32 - Success -- Performing Test HAVE_CXX_FLAG_WFLOAT_EQUAL -- Performing Test HAVE_CXX_FLAG_WFLOAT_EQUAL - Success -- Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING -- Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING - Success -- Performing Test HAVE_CXX_FLAG_WZERO_AS_NULL_POINTER_CONSTANT -- Performing Test HAVE_CXX_FLAG_WZERO_AS_NULL_POINTER_CONSTANT - Failed -- Performing Test HAVE_CXX_FLAG_WSTRICT_ALIASING -- Performing Test HAVE_CXX_FLAG_WSTRICT_ALIASING - Success -- Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY -- Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY - Success -- Performing Test HAVE_THREAD_SAFETY_ATTRIBUTES -- Performing Test HAVE_THREAD_SAFETY_ATTRIBUTES -- failed to compile -- Performing Test HAVE_CXX_FLAG_COVERAGE -- Performing Test HAVE_CXX_FLAG_COVERAGE - Success -- Performing Test HAVE_STD_REGEX -- Performing Test HAVE_STD_REGEX -- success -- Performing Test HAVE_GNU_POSIX_REGEX -- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile -- Performing Test HAVE_POSIX_REGEX -- Performing Test HAVE_POSIX_REGEX -- success -- Performing Test HAVE_STEADY_CLOCK -- Performing Test HAVE_STEADY_CLOCK -- success -- Performing Test BENCHMARK_HAS_CXX03_FLAG -- Performing Test BENCHMARK_HAS_CXX03_FLAG - Success -- Found LMDB: /usr/local/include
-- Found lmdb (include: /usr/local/include, library: /usr/local/lib/liblmdb.dylib) -- Found LevelDB: /usr/local/include
-- Found LevelDB (include: /usr/local/include, library: /usr/local/lib/libleveldb.dylib) -- Found Snappy: /usr/local/include
-- Found Snappy (include: /usr/local/include, library: /usr/local/lib/libsnappy.dylib) -- Could NOT find RocksDB (missing: RocksDB_INCLUDE_DIR RocksDB_LIBRARIES) CMake Warning at cmake/Dependencies.cmake:131 (message): Not compiling with RocksDB. Suppress this warning with -DUSE_ROCKSDB=OFF Call Stack (most recent call first): CMakeLists.txt:85 (include)

-- OpenCV found (/usr/local/share/OpenCV) -- Found PythonInterp: /usr/local/bin/python (found suitable version "2.7.13", minimum required is "2.7") -- Found PythonLibs: /usr/lib/libpython2.7.dylib (found suitable version "2.7.10", minimum required is "2.7") -- Found NumPy: /usr/local/lib/python2.7/site-packages/numpy-1.11.0-py2.7-macosx-10.11-x86_64.egg/numpy/core/include (found version "1.11.0") -- NumPy ver. 1.11.0 found (include: /usr/local/lib/python2.7/site-packages/numpy-1.11.0-py2.7-macosx-10.11-x86_64.egg/numpy/core/include) -- Found MPI_C: /usr/local/Cellar/open-mpi/2.1.0/lib/libmpi.dylib
-- Found MPI_CXX: /usr/local/Cellar/open-mpi/2.1.0/lib/libmpi.dylib
-- MPI support found -- MPI compile flags: -- MPI include path: /usr/local/Cellar/open-mpi/2.1.0/include -- MPI LINK flags path: -- MPI libraries: /usr/local/Cellar/open-mpi/2.1.0/lib/libmpi.dylib CMake Warning at cmake/Dependencies.cmake:221 (message): OpenMPI found, but it is not built with CUDA support. Call Stack (most recent call first): CMakeLists.txt:85 (include)

-- Try OpenMP C flag = [-fopenmp=libomp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [ ] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [/openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-Qopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-xopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [+Oopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-qsmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP C flag = [-mp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-fopenmp=libomp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [ ] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [/openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-Qopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-openmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-xopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [+Oopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-qsmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Try OpenMP CXX flag = [-mp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Failed -- Could NOT find OpenMP (missing: OpenMP_C_FLAGS OpenMP_CXX_FLAGS) CMake Warning at cmake/Dependencies.cmake:240 (message): Not compiling with OpenMP. Suppress this warning with -DUSE_OPENMP=OFF Call Stack (most recent call first): CMakeLists.txt:85 (include)

-- CUDA detected: 8.0 -- Added CUDA NVCC flags for: sm_30 -- Found libcuda: /Library/Frameworks/cuda.framework -- Found libnvrtc: /usr/local/cuda/lib/libnvrtc.dylib -- Found CUDNN: /usr/local/cuda/include
-- Found cuDNN: v5.1.5 (include: /usr/local/cuda/include, library: /usr/local/cuda/lib/libcudnn.dylib) CMake Warning at cmake/Dependencies.cmake:273 (message): NCCL is currently only supported under Linux. Call Stack (most recent call first): CMakeLists.txt:85 (include)

CMake Warning at cmake/Dependencies.cmake:303 (message): Gloo can only be used on Linux. Call Stack (most recent call first): CMakeLists.txt:85 (include)

-- Performing Test CAFFE2_LONG_IS_INT32_OR_64 -- Performing Test CAFFE2_LONG_IS_INT32_OR_64 - Failed -- Need to define long as a separate typeid. -- Performing Test HAS_BUILTIN_CPU_SUPPORTS -- Performing Test HAS_BUILTIN_CPU_SUPPORTS - Failed -- This compiler does not have builtin_cpu_supports feature. -- Performing Test CAFFE2_NEED_TO_TURN_OFF_DEPRECATION_WARNING -- Performing Test CAFFE2_NEED_TO_TURN_OFF_DEPRECATION_WARNING - Success -- Including MPI binaries -- Including OPENCV binaries -- NCCL operators built due to no CUDA support -- Including image processing operators -- Excluding mkl operators as we are not using mkl -- Automatically generating missing init.py files. -- -- **** Summary **** -- General: -- Git version : v0.7.0-10-g487864b -- System : Darwin -- C++ compiler : /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- Protobuf compiler : /usr/local/bin/protoc -- CXX flags : -std=c++11 -fPIC -Wno-narrowing -- Build type : Release -- Compile definitions : CAFFE2_USE_EIGEN_FOR_BLAS;CAFFE2_USE_GOOGLE_GLOG;CAFFE2_USE_GFLAGS;EIGEN_MPL2_ONLY;CAFFE2_FORCE_FALLBACK_CUDA_MPI;CAFFE2_UNIQUE_LONG_TYPEMETA;CAFFE2_NO_BUILTIN_CPU_SUPPORTS -- -- BUILD_SHARED_LIBS : ON -- BUILD_PYTHON : ON -- Python version : 2.7.10 -- Python library : /usr/lib/libpython2.7.dylib -- USE_CUDA : ON -- CUDA version : 8.0 -- USE_CNMEM : OFF -- USE_NERVANA_GPU : OFF -- USE_GLOG : ON -- USE_GFLAGS : ON -- USE_LMDB : ON -- LMDB version : 0.9.19 -- USE_LEVELDB : ON -- LevelDB version : 1.20 -- Snappy version : 1.1.4 -- USE_OPENCV : ON -- OpenCV version : 2.4.13.2 -- USE_ZMQ : OFF -- USE_ROCKSDB : OFF -- USE_MPI : ON -- USE_NCCL : OFF -- USE_NNPACK : OFF -- USE_OPENMP : OFF -- USE_REDIS : OFF -- USE_GLOO : OFF -- Configuring done -- Generating done

However, I met this error:

[ 48%] Building CXX object caffe2/CMakeFiles/Caffe2_CPU.dir/sgd/rmsprop_op.cc.o [ 49%] Building CXX object caffe2/CMakeFiles/Caffe2_CPU.dir/utils/math_cpu.cc.o [ 49%] Building CXX object caffe2/CMakeFiles/Caffe2_CPU.dir/utils/mkl/mkl_memory.cc.o [ 49%] Building CXX object caffe2/CMakeFiles/Caffe2_CPU.dir/utils/murmur_hash3.cc.o [ 49%] Building CXX object caffe2/CMakeFiles/Caffe2_CPU.dir/utils/proto_utils.cc.o [ 50%] Building CXX object caffe2/CMakeFiles/Caffe2_CPU.dir/utils/signal_handler.cc.o [ 50%] Building CXX object caffe2/CMakeFiles/Caffe2_CPU.dir/utils/string_utils.cc.o [ 50%] Building CXX object caffe2/CMakeFiles/Caffe2_CPU.dir/utils/threadpool/ThreadPool.cc.o [ 50%] Linking CXX shared library libCaffe2_CPU.dylib [ 50%] Built target Caffe2_CPU [ 50%] Building NVCC (Device) object caffe2/CMakeFiles/Caffe2_GPU.dir/utils/Caffe2_GPU_generated_math_gpu.cu.o /usr/local/include/google/protobuf/stubs/atomicops_internals_generic_c11_atomic.h(52): error: static assertion failed with "incompatible 32-bit atomic layout"

/usr/local/include/google/protobuf/stubs/atomicops_internals_generic_c11_atomic.h(145): error: static assertion failed with "incompatible 64-bit atomic layout"

2 errors detected in the compilation of "/var/folders/6t/v2s61xmx0wd80xnlbwcgxhn80000gn/T//tmpxft_00011b5b_00000000-7_math_gpu.cpp1.ii". CMake Error at Caffe2_GPU_generated_math_gpu.cu.o.Release.cmake:278 (message): Error generating file /Users/STW/Documents/Projects/caffe2/build/caffe2/CMakeFiles/Caffe2_GPU.dir/utils/./Caffe2_GPU_generated_math_gpu.cu.o

make[3]: [caffe2/CMakeFiles/Caffe2_GPU.dir/utils/Caffe2_GPU_generated_math_gpu.cu.o] Error 1 make[2]: [caffe2/CMakeFiles/Caffe2_GPU.dir/all] Error 2 make[1]: [all] Error 2 make: [all] Error 2

Any idea why it is happening?

Yangqing commented 7 years ago

This is a known protobuf-nvcc compatibility issue for some protobuf versions - if your mac does not have a cuda gpu, it might be easier to simply turn off cuda by -DUSE_CUDA=OFF.

hlzz commented 7 years ago

@Yangqing I do have a NVIDIA gpu. Do you know which specific protobuf version is affected? My configuration is the following:

Mac OS: 10.12.4 protobuf 3.2.0_1 clang: Apple LLVM version 8.0.0 (clang-800.0.42.1) nvcc: Cuda compilation tools, release 8.0, V8.0.61

jquave commented 7 years ago

@hlzz In the next protobuf release this is fixed, but for now I temporarily fixed it on my machine like this:

I open up my own version of this file in /usr/local/Cellar/protobuf/3.2.0_1/include/google/protobuf/stubs/atomicops.h and just manually commented out lines 198 through 205:

// Apple.
/*
#elif defined(GOOGLE_PROTOBUF_OS_APPLE)
#if __has_feature(cxx_atomic) || _GNUC_VER >= 407
#include <google/protobuf/stubs/atomicops_internals_generic_c11_atomic.h>
#else  // __has_feature(cxx_atomic) || _GNUC_VER >= 407
#include <google/protobuf/stubs/atomicops_internals_macosx.h>
#endif  // __has_feature(cxx_atomic) || _GNUC_VER >= 407
*/

In the official version of protobuf used by tensorflow, you can see this bit is actually just removed, so it seems to be the right thing to do until protobuf v3.2.1 is released, where this is fixed using the same approach.

hlzz commented 7 years ago

@jquave Thanks a lot! This temporarily fix the issue. Let's wait for the update of protobuf. I am closing this issue now.