-
Notifications
You must be signed in to change notification settings - Fork 4k
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
DeepSpeech fails on CPUs without AVX support #1157
Comments
The steps you followed seem to be correct. Maybe your CPU doesn't support some other instruction set that we compile with. Can you share more information on the CPU model? Specifically the output of this command: sysctl -n machdep.cpu.brand_string && sysctl -n machdep.cpu.features |
Oh good, I did something right! I used command:
and got
Is my computer just too bad to even run this? I honestly wouldn't doubt that. |
I suspect SSE4.2 is the culprit. Let me check. |
I was wrong, it's AVX, which your CPU does not support. Your best bet is building the bindings from source. The process is documented here: https://github.com/mozilla/DeepSpeech/blob/master/native_client/README.md |
To be clear, I need to follow the "Build Requirements" portion and skip the first sections "Installation, Required Dependencies, Installing the language bindings, Node.JS bindings"? |
Exactly! |
Okay, a few hours of troubleshooting and I'm stuck again. First, I followed these instructions: https://github.com/mozilla/DeepSpeech/blob/master/native_client/README.md and https://www.tensorflow.org/install/install_sources Namely, downloaded the DeepSpeech tensorflow repository, bazel, TensorFlow Python dependencies, etc up to (and including) "Configure the installation" on the https://www.tensorflow.org/install/install_sources website. Then I configured it by giving it the various paths to python and my site packages (as well as saying no to literally everything it asks about cloud computing, AWS, CUDA, etc). Then I put both DeepSpeech and tensorflow-master in the same directory. Tensorflow-master is the direct download from the DeepSpeech website, so it contains a folder named tensorflow as well. Within tensorflow-master, I ran:
then ran:
Which failed. I tried it again by cd'ing into the tensorflow folder within the tensorflow-master folder and ran:
That failed too. The error message is:
|
@DJ-Hayden can you make sure you used our tensorflow: https://github.com/mozilla/tensorflow ? And Bazel 0.5.4 ? Besides, |
@DJ-Hayden I had the same problem with my old MBP, so I installed the precompiled deepspeech from taskcluster as follow and it works now: |
@lissyx Ah shoot, I definitely have the mozilla tensorflow but the latest build of bazel (0.9.0 via homebrew). I'll use 0.5.4 and check it out. @cahya-wirawan I did that (albeit via the download the whl file to my laptop method) and got Illegal Instruction: 4. I uninstalled deepspeech, then used pip install https://index.taskcluster.net/v1/task/project.deepspeech.deepspeech.native_client.master.osx/artifacts/public/deepspeech-0.1.0-cp27-cp27m-macosx_10_10_x86_64.whl, and after it downloaded it still said "Illegal Instruction: 4" when I tried to run inference on the pre-trained model. |
My new steps are:
3a) cd into actual tensorflow folder (within the tensorflow-master folder) and check that
I'm doing something obviously wrong here but cd ../DeepSpeech/native_client ./ works fine, so I'm not sure why the alias isn't working at step 4). I thought I may need to run the ./configure with DeepSpeech already in the folder with tensorflow-master (instead of after, like I initially did), but doing that returned the same error. |
@DJ-Hayden Can you make sure the symlink is good? It's possible GNU / BSD |
@lissyx double-clicking on it within finder correctly takes me to the native_folder within DeepSpeech. It does already contain quite a bit of files so I'm not sure if that's the problem or not. |
@DJ-Hayden I'd prefer |
@lissyx ls -hal lists many things including
and |
I think your folder structure is incorrect. It should be:
You should invoke |
@reuben I thought that's what I was originally doing, but perhaps I got one of the steps slightly wrong. It is now running (albeit with a large swathe of warnings related to:
and:
There's quite a few other warnings (too many to list) but nothing has broken yet. It has been a few hours and it says " [2,405 / 2,410] Still waiting for 2 jobs to complete: " but that number has been increasing as the code runs. Once finished I'll cd into the DeepSpeech/native_client directory and run make deepspeech. Once that is done, should I do the source activate deepspeech-venv, cd to where deepspeech is in the native_client directory, then run the prebuilt model command? Or does the command "make deepspeech" effectively do the same as pip install deepspeech such that I can just run deepspeech from any folder within the console? |
The bazel build finished. I then tried to make deepspeech but it didn't recognize the directory initially. I looked at the makefile and it seems it's hardcoded as tensorflow/tensorflow and not tensorflow-master/tensorflow. I changed my tensorflow-master folder to tensorflow and reran make deepspeech in the appropriate place. It then said sox.h wasn't installed, so I did After that, it gave the following error:
I feel like we're really close, but there's something wrong. Those pathway warning are correct in that they are not found in the directory. |
Looks like $TFDIR is pointing to the wrong place. Did you set it? |
I didn't set it, but my_path/tensorflow(previously tensorflow-master)/bazel-bin only contains a reference to native_client, not tensorflow, as the error suggests: directory not found for option '-L/my_path/tensorflow/bazel-bin/tensorflow' |
Weird… You should have a |
Ah, that sounds like the topic of a lot of warnings I was getting. The very first thing that came up (as mentioned above) is:
Good news is that I just received a new Asus that will be running Ubuntu, so that's one way to solve the problem. |
Can you try building again? Things should be in cache this time so should not take as long. Hopefully that'll create the binaries normally. I see that warning on my system as well, but it doesn't break the build. |
Doing that now. Still a lot of warnings along the lines of:
I'll monitor other warnings and see if any are specifically about libtensorflow_cc |
Finally finished. The last lines are:
There were a number of warnings related to:
|
Oh, and when trying to make deepspeech, I get the following error:
|
@DJ-Hayden did you try to use python 3.5 and install deepspeech from taskcluster? because this is what I have in my old MBP and it works fine without recompiling anything which is very cumbersome as you see. |
Can you try doing |
Last night I ran:
and this morning I ran:
It seemingly worked, so I ran (when in the native client folder):
It states:
|
@DJ-Hayden Can you post you build commands? It seems you have some empty library name. DeepSpeech/native_client/Makefile Lines 23 to 27 in a03604d
|
Sure thing!
and build was the standard:
(which ran with a plethora of warnings) |
@DJ-Hayden Can you use proper formatting? it's really strange that you have only Also, we need your |
@lissyx Wasn't sure how, but now I see it and am editing all of my previous comments. My make statement was simply
while in the native_client folder |
@DJ-Hayden Ok, that makes more sense now. It's just that you need to help |
Awesome, thanks so much! I think it's finally working. I ran:
which output:
I presume "a obbushdtatsunshsenhamsohimestofarerermsholtfromtolthebdromsouwolddre" is the output, which I believe was due to the minute-long file I used and seems to be a known issue with longer files. I'll try a shorter five second version. In the future, will I need to do:
For every piece of audio I'd like to run? Or now that I've "made" it can I go back to the documented way of:
|
@DJ-Hayden Either you continue to I guess you can close the issue now :) |
@lissyx @reuben Thanks for all the help! When configuring I did use For now though, before I close the issue, how would I go about copying the libraries with the deepspeech binary? I'm at a bit of a loss as to why, in the native folder:
works but:
(again, in the native_client folder) doesn't. I used the full path name to deepspeech because |
Just pick (
From Regarding
|
Sweet, thanks again for all the help! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hello,
I am running through the standard set-up and was having some trouble on the final step. It appears to be a recurring issue, but the solution I believe is provided hasn't fixed the problem, which is why I'm assuming there is a bug. Very well may be me though so I've tried to describe every step.
I'm using a MacBook Pro 10.11.6 with a 2.4 GHz Intel Core 2 Duo Processor (incredibly old).
Tensorflow has not been installed (instruction don't seem to indicate it as a prerequisite).
Python is 2.7.
I first cloned the repository, but that doesn't seem to be important for what's next. Then I downloaded and unzipped the pre-trained model.
I set up a virtual environment for deepspeech using conda. Then I activated it and ran pip install deepspeech. After installation I ran:
This immediately got the "Illegal instruction: 4" and the code stopped.
After a bit of searching it seems like the problem is AVX2/FMA as documented here (#1057) and here (#1023).
The consensus seemed to be to go to https://tools.taskcluster.net/index/artifacts/project.deepspeech.deepspeech.native_client.master/osx and select deepspeech-0.1.0-cp27-cp27m-macosx_10_10_x86_64.whl (since I'm running python 2.7 with an old Mac).
Then, I uninstalled the current deepspeech with:
and ran:
while in a folder that contained that file.
Seemed to work, but then I ran:
once more and it still gives me the error "Illegal instruction: 4" and the code stopped.
Have I done something wrong here or is this still a bug?
The text was updated successfully, but these errors were encountered: