DeepSpeech icon indicating copy to clipboard operation
DeepSpeech copied to clipboard

Unable to get fresh install working: mutex lock failed error

Open adhsu opened this issue 9 years ago • 10 comments

I'm running into a brick wall getting DeepSpeech set up. I'm on macOS High Sierra (10.13 beta 17A362a). I'm using conda with python2.7.

I've set my $LD_LIBRARY_PATH to include the native_client folder that contains all the pre-built binaries. In taskcluster I selected "osx" architecture and downloaded native_client.tar.xz and deepspeech-0.0.1-cp27-cp27m-macosx_10_12_x86_64.whl.

Here's the error

without deepspeech python wheel installed:

(mozilla_ds) ➜  mozilla_ds git:(master) ✗ ./bin/run-ldc93s1.sh
+ '[' '!' -f DeepSpeech.py ']'
+ '[' '!' -f data/ldc93s1/ldc93s1.csv ']'
+ '[' -d '' ']'
++ python -c 'from xdg import BaseDirectory as xdg; print(xdg.save_data_path("deepspeech/ldc93s1"))'
+ checkpoint_dir=/Users/adhtest/.local/share/deepspeech/ldc93s1
+ python -u DeepSpeech.py --train_files data/ldc93s1/ldc93s1.csv --dev_files data/ldc93s1/ldc93s1.csv --test_files data/ldc93s1/ldc93s1.csv --train_batch_size 1 --dev_batch_size 1 --test_batch_size 1 --n_hidden 494 --epoch 50 --checkpoint_dir /Users/adhtest/.local/share/deepspeech/ldc93s1
python(91590,0x7fffb3d4f340) malloc: *** error for object 0x2e656c6966206568: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
./bin/run-ldc93s1.sh: line 29: 91590 Abort trap: 6           python -u DeepSpeech.py --train_files data/ldc93s1/ldc93s1.csv --dev_files data/ldc93s1/ldc93s1.csv --test_files data/ldc93s1/ldc93s1.csv --train_batch_size 1 --dev_batch_size 1 --test_batch_size 1 --n_hidden 494 --epoch 50 --checkpoint_dir "$checkpoint_dir" "$@"

WITH python wheel installed:

(mozilla_ds) ➜  mozilla_ds git:(master) ✗ ./bin/run-ldc93s1.sh
+ '[' '!' -f DeepSpeech.py ']'
+ '[' '!' -f data/ldc93s1/ldc93s1.csv ']'
+ '[' -d '' ']'
++ python -c 'from xdg import BaseDirectory as xdg; print(xdg.save_data_path("deepspeech/ldc93s1"))'
+ checkpoint_dir=/Users/adhtest/.local/share/deepspeech/ldc93s1
+ python -u DeepSpeech.py --train_files data/ldc93s1/ldc93s1.csv --dev_files data/ldc93s1/ldc93s1.csv --test_files data/ldc93s1/ldc93s1.csv --train_batch_size 1 --dev_batch_size 1 --test_batch_size 1 --n_hidden 494 --epoch 50 --checkpoint_dir /Users/adhtest/.local/share/deepspeech/ldc93s1
libc++abi.dylib: terminating with uncaught exception of type std::__1::system_error: mutex lock failed: Invalid argument
./bin/run-ldc93s1.sh: line 29: 91531 Abort trap: 6           python -u DeepSpeech.py --train_files data/ldc93s1/ldc93s1.csv --dev_files data/ldc93s1/ldc93s1.csv --test_files data/ldc93s1/ldc93s1.csv --train_batch_size 1 --dev_batch_size 1 --test_batch_size 1 --n_hidden 494 --epoch 50 --checkpoint_dir "$checkpoint_dir" "$@"

It seems like the key line is: libc++abi.dylib: terminating with uncaught exception of type std::__1::system_error: mutex lock failed: Invalid argument

Is this a problem with the libctc_decoder_with_kenlm.so? Any help would be appreciated; I've been stuck on this for several days.

adhsu avatar Nov 03 '17 05:11 adhsu

Upon further investigation, I found that within my environment, I can load python, then do:

>>> import tensorflow as tf
>>> tf.load_op_library("/Users/adhtest/ds_native_client/libctc_decoder_with_kenlm.so")
python(1190,0x7fffa33bb340) malloc: *** error for object 0x7fbc6ed08350: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

So the issue is with tensorflow not being able to load the decoder.

adhsu avatar Nov 03 '17 05:11 adhsu

@adhsu Did you installed tensorflow using https://index.taskcluster.net/v1/task/project.deepspeech.tensorflow.pip.master.osx/artifacts/public/tensorflow_warpctc-1.3.0rc0-cp27-cp27m-macosx_10_12_x86_64.whl ? There might be API incompatibilities between libctc_decoder_with_kenlm.so and upstream codebase.

lissyx avatar Nov 03 '17 08:11 lissyx

I did not - thanks for the info. I created a fresh conda environment and ran these 3 commands:

pip install --upgrade https://index.taskcluster.net/v1/task/project.deepspeech.tensorflow.pip.master.osx/artifacts/public/tensorflow_warpctc-1.3.0rc0-cp27-cp27m-macosx_10_12_x86_64.whl

pip install --upgrade https://index.taskcluster.net/v1/task/project.deepspeech.deepspeech.native_client.master.osx/artifacts/public/deepspeech-0.0.1-cp27-cp27m-macosx_10_12_x86_64.whl

grep -v tensorflow requirements.txt | pip install --upgrade -r /dev/stdin

Now I get this error:

+ '[' '!' -f DeepSpeech.py ']'
+ '[' '!' -f data/ldc93s1/ldc93s1.csv ']'
+ '[' -d '' ']'
++ python -c 'from xdg import BaseDirectory as xdg; print(xdg.save_data_path("deepspeech/ldc93s1"))'
+ checkpoint_dir=/Users/adhtest/.local/share/deepspeech/ldc93s1
+ python -u DeepSpeech.py --train_files data/ldc93s1/ldc93s1.csv --dev_files data/ldc93s1/ldc93s1.csv --test_files data/ldc93s1/ldc93s1.csv --train_batch_size 1 --dev_batch_size 1 --test_batch_size 1 --n_hidden 494 --epoch 50 --checkpoint_dir /Users/adhtest/.local/share/deepspeech/ldc93s1
**2017-11-03 10:06:00.527171: F tensorflow/stream_executor/host/host_platform.cc:112] Non-OK-status: gpu::MultiPlatformManager::RegisterPlatform(std::move(platform)) status: Internal: platform is already registered with name: "Host"**
./bin/run-ldc93s1.sh: line 29:  1060 Abort trap: 6           python -u DeepSpeech.py --train_files data/ldc93s1/ldc93s1.csv --dev_files data/ldc93s1/ldc93s1.csv --test_files data/ldc93s1/ldc93s1.csv --train_batch_size 1 --dev_batch_size 1 --test_batch_size 1 --n_hidden 494 --epoch 50 --checkpoint_dir "$checkpoint_dir" "$@"

adhsu avatar Nov 03 '17 17:11 adhsu

Are you trying to perform training on OSX ? You should know that upstream stopped supporting CUDA on OSX, thus training would not be fast :)

lissyx avatar Nov 03 '17 18:11 lissyx

Yeah - I eventually want to move everything to a google cloud compute instance, but for now I'm trying to get it working locally on my Mac. Do you think the error is mac-specific?

adhsu avatar Nov 03 '17 18:11 adhsu

Can you try without Anaconda? A lot of people report weird problems with it, try on a virtualenv using system Python.

reuben avatar Nov 03 '17 18:11 reuben

Thank you for the thought. I just tried again with virtualenv+pip, using brew python2.7, and I get the same error:

2017-11-06 09:46:11.212648: F tensorflow/stream_executor/host/host_platform.cc:112] Non-OK-status: gpu::MultiPlatformManager::RegisterPlatform(std::move(platform)) status: Internal: platform is already registered with name: "Host"

Could it be possibly trying to use the gpu inappropriately? Sorry, I am all out of ideas and googling gets me nowhere.

adhsu avatar Nov 06 '17 17:11 adhsu

@adhsu I'm sorry, but it's advertised clearly on TensorFlow's website: https://www.tensorflow.org/install/install_mac

"Note: As of version 1.2, TensorFlow no longer provides GPU support on macOS."

There's nothing we can do.

lissyx avatar Dec 14 '17 22:12 lissyx

Is there any way to train custom data sets on a Mac then?

peterw243 avatar Jan 12 '18 08:01 peterw243

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.

lock[bot] avatar Jan 03 '19 04:01 lock[bot]