Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Pip Package Failed on Windows v1.8.0 with GPU #19103

Closed
yoshimur opened this issue May 5, 2018 · 20 comments
Closed

Build Pip Package Failed on Windows v1.8.0 with GPU #19103

yoshimur opened this issue May 5, 2018 · 20 comments
Assignees
Labels
type:build/install Build and install issues

Comments

@yoshimur
Copy link

yoshimur commented May 5, 2018

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No!!
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows 10
  • TensorFlow installed from (source or binary): Source
  • TensorFlow version (use command below): v1.8.0
  • Python version: 3.6
  • Bazel version (if compiling from source): CMake
  • GCC/Compiler version (if compiling from source): VS 2015
  • CUDA/cuDNN version: 9.1
  • GPU model and memory: GTX-1070 8GB
  • Exact command to reproduce:
    git pull
    git checkout refs/tags/v1.8.0
    cd tensorflow\contrib\cmake
    mkdir build
    cd build
    cmake .. -A x64 -DCMAKE_BUILD_TYPE=Release ^
    -DSWIG_EXECUTABLE=C:\swigwin-3.0.12\swig.exe ^
    -DPYTHON_EXECUTABLE=C:\Anaconda3\python.exe ^
    -DPYTHON_LIBRARIES=C:\Anaconda3\libs\python36.lib ^
    -Dtensorflow_ENABLE_GPU=ON ^
    -DCUDNN_HOME="%CUDA_PATH%" ^
    -Dtensorflow_CUDA_VERSION=9.1 ^
    -Dtensorflow_WIN_CPU_SIMD_OPTIONS=/arch:AVX2

MSBuild /p:Configuration=Release tf_tutorials_example_trainer.vcxproj

MSBuild /p:Configuration=Release tf_python_build_pip_package.vcxproj

After this command, following error was occured. Sorry, this is Japanese System message.
But, problem is seems missing the "tensorflow/python/framework/cpp_shape_inference.pb.h"

"C:\repo\tensorflow\tensorflow\contrib\cmake\build\tf_python_build_pip_package.
vcxproj" (既定のターゲット) (1) ->
"C:\repo\tensorflow\tensorflow\contrib\cmake\build\pywrap_tensorflow_internal.v
cxproj" (既定のターゲット) (2) ->
"C:\repo\tensorflow\tensorflow\contrib\cmake\build\pywrap_tensorflow_internal_s
tatic.vcxproj" (既定のターゲット) (3) ->
"C:\repo\tensorflow\tensorflow\contrib\cmake\build\tf_c_python_api.vcxproj" (既 定
のターゲット) (134) ->
(ClCompile ターゲット) ->
C:\repo\tensorflow\tensorflow\c\python_api.cc(19): fatal error C1083: include
ファイルを開けません。'tensorflow/python/framework/cpp_shape_inference.pb.h':No such file
or directory [C:\repo\tensorflow\tensorflow\contrib\cmake\build\tf_c_python_ap
i.vcxproj]

90 個の警告 (Note: 90's Warning)
1 エラー (Note: Error)

Best regards.

@darindf
Copy link

darindf commented May 7, 2018

I have similar issue as well, except my errors are in english

"C:\Users\user\Documents\tensorflow\tensorflow\contrib\cmake\buildr1.8\tf_python_build_pip_package.vcxproj" (default ta
rget) (1) ->
"C:\Users\user\Documents\tensorflow\tensorflow\contrib\cmake\buildr1.8\pywrap_tensorflow_internal.vcxproj" (default tar
get) (2) ->
"C:\Users\user\Documents\tensorflow\tensorflow\contrib\cmake\buildr1.8\pywrap_tensorflow_internal_static.vcxproj" (defa
ult target) (3) ->
"C:\Users\user\Documents\tensorflow\tensorflow\contrib\cmake\buildr1.8\tf_c_python_api.vcxproj" (default target) (134)
->
(ClCompile target) ->
  C:\Users\user\Documents\tensorflow\tensorflow\c\python_api.cc(19): fatal error C1083: Cannot open include file: 'tens
orflow/python/framework/cpp_shape_inference.pb.h': No such file or directory [C:\Users\user\Documents\tensorflow\tensor
flow\contrib\cmake\buildr1.8\tf_c_python_api.vcxproj]

    20441 Warning(s)
    1 Error(s)

@shivaniag shivaniag added the type:build/install Build and install issues label May 9, 2018
@shivaniag
Copy link
Contributor

@gunan could you take a look.

@shivaniag shivaniag added the stat:awaiting tensorflower Status - Awaiting response from tensorflower label May 9, 2018
@gunan
Copy link
Contributor

gunan commented May 10, 2018

It is possible we have missed a bug with /arch:AVX2.
Otherwise, I think there is an earlier protobuf error we are missing, that results in this file not being generated on your system. Since r1.8 builds just fine in our CI, I am not sure what may be going wrong for you.

@gunan gunan added stat:awaiting response Status - Awaiting response from author and removed stat:awaiting tensorflower Status - Awaiting response from tensorflower labels May 10, 2018
@yoshimur
Copy link
Author

I try to build v1.8 branch, but same error is occured.
In v 1.7.0 case, these command is works fine. I can get the Pip Package.
For this reason, I think this compile error was v1.8 related error.

@darindf
Copy link

darindf commented May 10, 2018

What is generating this file? I can see if that part is working or not.

@yoshimur
Copy link
Author

In v.1.7.0 case. generated file is "tensorflow_gpu-1.7.0-cp36-cp36m-win_amd64.whl"
And, I try some function, it seems work fine.
Sorry, can not attach the file, it is too big for attach.

@tensorflowbutler tensorflowbutler removed the stat:awaiting response Status - Awaiting response from author label May 11, 2018
@sleighsoft
Copy link
Contributor

Is this also the reason why there are no new windows builds for tf-nightly right now?

@gunan
Copy link
Contributor

gunan commented May 13, 2018 via email

@steven-hh-ding
Copy link

Same error here. Windows 10. VS 17. Master branch.

cmake .. -G "Visual Studio 15 2017 Win64" ^
 -T host=x64 ^
 -DCMAKE_BUILD_TYPE=RelWithDebInfo ^
 -DSWIG_EXECUTABLE=D:\tf-build\swigwin-3.0.12\swig.exe ^
 -DPYTHON_EXECUTABLE=D:\Program-Files\anaconda\envs\tensorflow\python.exe ^
 -DPYTHON_LIBRARIES=D:\Program-Files\anaconda\envs\tensorflow\libs\python35.lib ^
 -Dtensorflow_BUILD_PYTHON_TESTS=ON

MSBuild /p:Configuration=RelWithDebInfo tf_python_build_pip_package.vcxproj

msg:
d:\tf-build\tensorflow\tensorflow\c\python_api.cc(19): fatal error C1083: Cannot open include file: 'tensorflow/pytho
n/framework/cpp_shape_inference.pb.h': No such file or directory [D:\tf-build\tensorflow\tensorflow\contrib\cmake\tf18b
ld\tf_c_python_api.vcxproj]

@gunan
Copy link
Contributor

gunan commented May 18, 2018

Could you share the full log using pastebin?
The error message means a proto file failed to build somewhere earlier in the build.

@steven-hh-ding
Copy link

Looks like it is too big for pastebin. So I attach the log here. Thanks! @gunan

tf.mb.cmake.cpu.vs17.log

@gunan
Copy link
Contributor

gunan commented May 18, 2018

What you are seeing is different. In your case, you are running into this failure.
https://msdn.microsoft.com/en-us/library/zww6zdh7.aspx

You may want to try the "Release" configuration.

@steven-hh-ding
Copy link

Thank you @gunan . Using 'release' did remove all C2471. However C1083 is still there. Please find the attached log.
msbuild.log

Anyway, since I just need the header files to build an user_opr under windows. I use branch r1.7 instead.

@HarryHHung
Copy link

Thanks to @skydes's comment in #18931, I applied the patched line to tensorflow/contrib/cmake/tf_core_framework.cmake and successfully built r1.8.0 wheel with AVX2 support enabled.

@yoshimur
Copy link
Author

yoshimur commented Jun 6, 2018 via email

@AshimaChawla
Copy link

Hi @yoshimur, Thanks very much..

Everything is working fine now..

The only issue I am seeing is when I execute my code, it seem to be bit slower than I used to execute on GPU. Is it something because of Windows ??

Is Ubuntu much faster than that?

/Ashima

@tensorflowbutler
Copy link
Member

Nagging Assignees @gunan, @shivaniag: It has been 15 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

@luranhe
Copy link

luranhe commented Jun 24, 2018

I had the same problem (Win10, VS2015, CUDA 9.1, AVX2, with MKL, without gRPC).

I checked tensorflow/python/framework and saw that the cpp_shape_inference.pb.h file was in there. So I just ran the MSBuild command again and the build completed (WHL file produced)!

Lmk if I should include more info. This is my first post to a Github issue, plz be nice. :)

@gunan
Copy link
Contributor

gunan commented Jun 25, 2018

Thanks for the tip, this is really helpful.
Could you copy/paste your build output to pastebin for us to be able to see the error message?
@annarev According to the comment by @luranhe could this be a missing dependency in cmake for api generation?

@luranhe
Copy link

luranhe commented Jun 25, 2018

Unfortunately, I don't have the build output from the failed build anymore, I didn't save it anywhere and the command line only saves so much history. Many apologies.

It definitely failed on tf_c_python_api.vcxproj because of "no such file or directory" of file cpp_shape_inference.pb.h, which clearly existed at the indicated location.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

10 participants