Build DeepSpeech on Windows: tfcompile_flags error

Hi there,

I am attempting the task of getting DeepSpeech to build on Windows, by using DeepSpeech’s release of tensorflow (here: https://github.com/mozilla/tensorflow/tree/r1.11) , and bazel. I have been able to install Bazel successfully, and get it running properly on example files as described here: https://docs.bazel.build/versions/master/windows.html.

After this, I tried to build tensorflow and deepspeech on windows using bazel as described here: https://github.com/mozilla/DeepSpeech/blob/master/native_client/README.md, and to the best of my knowledge have been able to get the previous steps done successfully. However when I come to the section about building in this webpage, and run the statements:

bazel build -c opt --copt=-O3 --copt="-D_GLIBCXX_USE_CXX11_ABI=0" native_client:libctc_decoder_with_kenlm.so

I get an error as follows:

WARNING: Option ‘experimental_shortened_obj_file_path’ is deprecated
ERROR: G:/pradyumna/smartscribe/codes_and_scripts/tensorflow/native_client/BUILD:18:1: Traceback (most recent call last):
File “G:/pradyumna/smartscribe/codes_and_scripts/tensorflow/native_client/BUILD”, line 18
tf_library(name = “deepspeech_model_core”, cp…", <5 more arguments>)
File “C:/users/pradyumna m k prasad/_bazel_pradyumna m k prasad/kemb47d3/external/org_tensorflow/tensorflow/compiler/aot/tfcompile.bzl”, line 170, in tf_library
" “.join([((”’" + arg.replace("’", “’\’’… [])])
File “C:/users/pradyumna m k prasad/_bazel_pradyumna m k prasad/kemb47d3/external/org_tensorflow/tensorflow/compiler/aot/tfcompile.bzl”, line 170, in " “.join
[((”’” + arg.replace("’", “’\’’”)) + “’”) for arg in (tfcompile_flags or [])]
type ‘select’ is not iterable
ERROR: error loading package ‘native_client’: Package ‘native_client’ contains errors

It is worth mentioning that in the folder native_client, there does not seem to be any file named “libctc_decoder_with_kenlm.so”, so am I missing a file?

I expected this entire process to be difficult as it is on windows, but after overcoming many issues, I am stuck here. Please ask me if you need any more information. Help would be really appreciated.

Thank you!

Thanks for this. As a general reminder, please make sure you post console output using proper code formatting: it’s easier to read and if you don’t, do that, some useful informations might be eaten.

So, just to be clear, we don’t support Windows (yet?) so, I’m not totally surprised you run into issues.

Please document which version you use? TensorFlow r1.11 recommends using Bazel 0.15, we have no problem with 0.15.2 on the other systems.

We don’t have that anymore, so I think you are not on the latest branch of master.

There is no need to build TensorFlow.

Thank you very much, @lissyx for your reply.

When I had this issue, I was using Bazel 0.17 so maybe that is causing an issue. I will update here after trying the process with Bazel 0.15.

You say that it is not necessary for me to buid tensorflow, but in the page with the instructions to build DeepSpeech (https://github.com/mozilla/DeepSpeech/blob/master/native_client/README.md) it is advised to checkout your branch of tensorflow and build it (indicated in the figure below). Am I missing something?

Will the building of DeepSpeech work with a “traditional” installation of TensorFlow?

you will need to prepare your environment to configure and build TensorFlow

We don’t say that you have to build TensorFlow. Just that you need to follow the upstream instructions to setup your system. This is emphasized with:

up to the end of ‘Configure the installation’

Sorry if it’s not clear enough, PR are welcome.

No, you need to use our fork.

Thank you @lissyx. Your suggestion fixed one part of my problem. I downloaded the latest master branch, and used bazel 0.15. The first command to build

native_client:libctc_decoder_with_kenlm.so

builds successfully now. However with the second command :

bazel build --config=monolithic -c opt --copt=-O3 --copt="-D_GLIBCXX_USE_CXX11_ABI=0" --copt=-fvisibility=hidden //native_client:libdeepspeech.so //native_client:generate_trie

I am running into another error now.

c:\users\pradical pras\_bazel_pradical pras\kemb47d3\execroot\org_tensorflow\external\eigen_archive\unsupported\eigen\src/SpecialFunctions/SpecialFunctionsImpl.h(712): warning: missing return statement at end of non-void function "Eigen::internal::igamma_series_impl<Scalar, mode>::run [with Scalar=double, mode=Eigen::internal::SAMPLE_DERIVATIVE]"
          detected during:
            instantiation of "Scalar Eigen::internal::igamma_series_impl<Scalar, mode>::run(Scalar, Scalar) [with Scalar=double, mode=Eigen::internal::SAMPLE_DERIVATIVE]"
(863): here
            instantiation of "Scalar Eigen::internal::igamma_generic_impl<Scalar, mode>::run(Scalar, Scalar) [with Scalar=double, mode=Eigen::internal::SAMPLE_DERIVATIVE]"
(2108): here
            instantiation of "Eigen::internal::gamma_sample_der_alpha_retval<Eigen::internal::global_math_functions_filtering_base<Scalar, void>::type>::type Eigen::numext::gamma_sample_der_alpha(const Scalar &, const Scalar &) [with Scalar=double]"
c:\users\pradical pras\_bazel_pradical pras\kemb47d3\execroot\org_tensorflow\external\eigen_archive\unsupported\eigen\src/SpecialFunctions/arch/CUDA/CudaSpecialFunctions.h(154): here

1 error detected in the compilation of "C:/Users/PRADI~1/AppData/Local/Temp/nvcc_inter_files_tmp_dir/betainc_op_gpu.cu.compute_70.cpp1.ii".
INFO: Elapsed time: 24.784s, Critical Path: 19.26s
INFO: 11 processes: 11 local.
FAILED: Build did NOT complete successfully

It does not mention much else, and is difficult to decode the reason. It seems to be while dealing with the file

c:\users\pradical pras\_bazel_pradical pras\kemb47d3\execroot\org_tensorflow\external\eigen_archive\unsupported\eigen\src/SpecialFunctions/arch/CUDA/CudaSpecialFunctions.h(154)

For some context, the directories of this file is where the build output of bazel is currently located. Do you know where the issue might be?

Nope, and this is CUDA-specific, on Windows, I really cannot help more there.
I see you have spaces in your path, is that right? This might make choke some compilers …

Hmm it seems strange that spaces would choke it for that file alone, as it seems to have built other files to that path (for example, the file before )

You never know. I got tricked into build issue because of directory name containing -L and some build system would take that as a gcc flag …

Are you building for CUDA ? Maybe you should try without at first ?