Compiling for Windows

That does not look like a problem, it’s just telling you the client is already built. What error are you getting when running it? We can’t help if you don’t tell us what’s going on :stuck_out_tongue:

Using the Windows clients in C# and the examples also in C#, you can see the examples here

Sorry, I can’t help you with that, not tried to run the C++ clients, for the Windows BUILDS there’s a lot of thing to do.

Hi Reuben,

Actually I realize now that was just my mistake. I had the prebuilt binary sitting in the same directory. I deleted it and tried again with a fresh install. I am using MingW. The error is:

$ make deepspeech
c++ -std=c++11 -o deepspeech pkg-config --cflags sox client.cc -LD:/Programs/deepspeech_build_v2/tensorflow/tensorflow/bazel-bin/native_client -ldeepspeech pkg-config --libs sox
process_begin: CreateProcess(NULL, c++ -std=c++11 -o deepspeech pkg-config --cflags sox client.cc -LD:/Programs/deepspeech_build_v2/tensorflow/tensorflow/bazel-bin/native_client -ldeepspeech pkg-config --libs sox, …) failed.
make (e=2): The system cannot find the file specified.
make: *** [Makefile:22: deepspeech] Error 2
(tensorflow-deepspeech)

One thing that really confuses me about the build instructions is the directory structure. Are we supposed to have a structure like:

folder/DeepSpeech
folder/tensorflow

or

folder/tensorflow
folder/tensorflow/DeepSpeech

The line here https://github.com/mozilla/DeepSpeech/blob/master/native_client/README.md, “By default, the Makefile will assume there is a TensorFlow checkout in a directory above the DeepSpeech checkout. If that is not the case, set the environment variable TFDIR to point to the right directory.” Implies to me it is the latter, the Deepspeech folder should reside inside the tensorflow folder. But the line immediately afterwards:

‘’’
cd …/DeepSpeech/native_client
make deepspeech
‘’’
has to imply the two folders are at the same level with respect to the root right? As immediately before this set, is the build step from the tensorflow folder using bazel.

In the mean time I am going to try Carlos’s C# example link.

Thank you,

Kuhan

I don’t think anyone has built on MinGW before, so you’re breaking new ground.

Yes, it’s this one. And then inside of tensorflow you create a symlink for DeepSpeech/native_client.

I am afraid I am quite lost with respect to C# fundamentals. How exactly does one generate inference examples like that I have seen earlier in this thread using the example?

Loading the C# from net_framework solution file in Visual Studio I can build the executables. I can see that there are two executables in DeepSpeechWPF and DeepSpeechConsole.

But if I try to execute either one from the command line I receive the message:

Loading model…

Unhandled Exception: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at DeepSpeechClient.NativeImp.DS_CreateModel(String aModelPath, UInt32 aNCep, UInt32 aNContext, String aAlphabetConfigPath, UInt32 aBeamWidth, ModelState**& pint)
at DeepSpeechClient.DeepSpeech.CreateModel(String aModelPath, UInt32 aNCep, UInt32 aNContext, String aAlphabetConfigPath, UInt32 aBeamWidth) in D:\Programs\deepspeech_build_v2\tensorflow\DeepSpeech\examples\net_framework\CSharpExamples\DeepSpeechClient\DeepSpeech.cs:line 63
at CSharpExamples.Program.Main(String[] args) in D:\Programs\deepspeech_build_v2\tensorflow\DeepSpeech\examples\net_framework\CSharpExamples\DeepSpeechConsole\Program.cs:line 53

I feel I am doing something obviously wrong owing to my ignorance of C# basics.

Like you said, with the console example. Or with the WPF example in two ways, with selecting a file or recording the Windows output. For the most basic usage you can see the console example.

I’m investigating your error, can you share more info for like the versions of the model that you are using, also the command that you are passing to the client?

I know your error now, you are not running on x64 config, if I try to run it on default config the same error code shows.

Please follow
Go to the configuration manager on your VS :

Then you should select x64 for all the projects:

Sometimes VS loads the default config and not x64. Let me know if this not fix your issue.

Hi all,

I figured it out. For future reference, it has to do with the fact I am on a 64 bit machine. By right clicking on the net_framework project then ->Properties->Configuration Properties than in the dropdown menus explicitly set the compilation platform to x64. Like this:

,

afterwards, clean and rebuild the application. Then, run “debug” DeepSpeechConsole directly from Visual Studio and the executable will work.

I come from a C++ Linux development background so Visual Studio is sheer information overload for me. I barely understand what all the tabs and windows do. I am still feeling it out but that seems to have gotten me finally to the point where I can run inference on an arbitrary wav file.

I’d like to build a small program based on this example to batch process multiple wav files the program is to be ran in a Windows 10 environment. I’ll let you folks know how it goes.

Kuhan

You mean multiple at the same time? I’m afraid that the native client only allows one at time.

Haha it was funny to se the same answer with the same image at the same time.

Hi, can you take a look to https://github.com/mozilla/DeepSpeech/pull/1895 and let me know if it is clear enough? Please suggest any changes :slight_smile:

1 Like