DeepSpeech icon indicating copy to clipboard operation
DeepSpeech copied to clipboard

error running Deepspeech

Open msobhan69 opened this issue 9 years ago • 9 comments

when I execute ./Deepspeech.py , it fails. See below

STARTING Epoch 0000 I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:0) -> (device: 0, name: TITAN X (Pascal), pci bus id: 0000:02:00.0) I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:1) -> (device: 1, name: TITAN X (Pascal), pci bus id: 0000:01:00.0) I tensorflow/core/common_runtime/simple_placer.cc:669] Ignoring device specification /GPU:0 for node 'tower_0/padding_fifo_queue_DequeueMany' because the input edge from 'padding_fifo_queue' is a reference connection and already has a device field set to /GPU:1 Training model... Exception in thread Thread-8: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 754, in run self.__target(*self.__args, **self.__kwargs) File "/home/gata/git/DeepSpeech/util/importers/librivox.py", line 108, in _populate_batch_queue self._y_length: target_len}) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 767, in run run_metadata_ptr) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 944, in _run % (np_val.shape, subfeed_t.name, str(subfeed_t.get_shape()))) ValueError: Cannot feed value of shape (106, 26) for Tensor u'Placeholder:0', which has shape '(?, 494)'

Exception in thread Thread-6: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 754, in run self.__target(*self.__args, **self.__kwargs) File "/home/gata/git/DeepSpeech/util/importers/librivox.py", line 108, in _populate_batch_queue self._y_length: target_len}) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 767, in run run_metadata_ptr) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 944, in _run % (np_val.shape, subfeed_t.name, str(subfeed_t.get_shape()))) ValueError: Cannot feed value of shape (105, 26) for Tensor u'Placeholder:0', which has shape '(?, 494)'

msobhan69 avatar Apr 08 '17 04:04 msobhan69

Could you execute the code as indicated in the README.md[1]:

DeepSpeech$ ./bin/run-ldc93s1.sh

or in the case of the librivox data set, which it looks like you're trying to use:

DeepSpeech$ ./bin/run-librivox.sh

and report back on what occurs.

kdavis-mozilla avatar Apr 08 '17 11:04 kdavis-mozilla

actually I execute bellow and get the error: DeepSpeech$ ./bin/run-librivox.sh The problem is solved, if I change thread_count to 0 in util/importer/librivox.py.

But, for a many hours, just I have no change in progress and show below:

STARTING Optimization

I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:0) -> (device: 0, name: TITAN X (Pascal), pci bus id: 0000:02:00.0) I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:1) -> (device: 1, name: TITAN X (Pascal), pci bus id: 0000:01:00.0) STARTING Epoch 0000 I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:0) -> (device: 0, name: TITAN X (Pascal), pci bus id: 0000:02:00.0) I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:1) -> (device: 1, name: TITAN X (Pascal), pci bus id: 0000:01:00.0) I tensorflow/core/common_runtime/simple_placer.cc:669] Ignoring device specification /GPU:0 for node 'tower_0/padding_fifo_queue_DequeueMany' because the input edge from 'padding_fifo_queue' is a reference connection and already has a device field set to /GPU:1 Training model...

msobhan69 avatar Apr 08 '17 12:04 msobhan69

Are you by any chance running from the Deep Speech 2 branch, or with your own importer? The error means you're trying to feed examples into the queue that have the wrong shape. Specifically, it looks like you're feeding the MFCC features without any context, which is what DS2 does.

Does the error still happen on a clean checkout of the master branch?

On Apr 8, 2017 9:19 AM, "msobhan69" [email protected] wrote:

actually I execute bellow and get the error: DeepSpeech$ ./bin/run-librivox.sh The problem is solved, if I change thread_count to 0 in util/importer/librivox.py.

But, for a many hours, just I have no change in progress and show below:

STARTING Optimization

I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:0) -> (device: 0, name: TITAN X (Pascal), pci bus id: 0000:02:00.0) I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:1) -> (device: 1, name: TITAN X (Pascal), pci bus id: 0000:01:00.0) STARTING Epoch 0000 I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:0) -> (device: 0, name: TITAN X (Pascal), pci bus id: 0000:02:00.0) I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:1) -> (device: 1, name: TITAN X (Pascal), pci bus id: 0000:01:00.0) I tensorflow/core/common_runtime/simple_placer.cc:669] Ignoring device specification /GPU:0 for node 'tower_0/padding_fifo_queue_DequeueMany' because the input edge from 'padding_fifo_queue' is a reference connection and already has a device field set to /GPU:1 Training model...

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mozilla/DeepSpeech/issues/510#issuecomment-292714480, or mute the thread https://github.com/notifications/unsubscribe-auth/AAdH1sNTUSicy3OAMAM1-q4w6Zc2CoiIks5rt3s4gaJpZM4M3leT .

reuben avatar Apr 08 '17 12:04 reuben

@msobhan69 You realize if you change thread_count to 0 the importer will do nothing as there are no threads to push data to the network. Thus the behaviour you observed.

Could you test a clean checkout of master using the command

DeepSpeech$ ./bin/run-librivox.sh

kdavis-mozilla avatar Apr 08 '17 12:04 kdavis-mozilla

@msobhan69

The importers define the tensor shapes. From my very limited knowledge it seems like you ran and saved a checkpoint from a previous run. Then to me it looks like you changed the way the dimensions for the shape are defined in the importer file and ran it again. The previous checkpoint dimensions do not match so Tensor Flow throws this error.

I would follow @kdavis-mozilla advice or at the very least if you created or edited an import file revert to using the original. Basically if you are running 'run-librivox.sh' then restore the 'run-librivox.sh' and the /DeepSpeech/util/importers/librivox.py.

When you do this it will still probably break at the same point unless you run the same script that ran previously or at least a model with the same shape. In this case simply provide a flag for checkpoint_dir ./bin/run-librivox.sh --checkpoint_dir ~/DeepSpeech/checkpoints/my_librivox_model_dir

Like I said it appears that you were running successfully at some point before. I ran for 10 hours without knowing for sure it was working. Try adding these flags to your command next time if you are unsure if it is running.

--log_level 0
--log_traffic True
--fulltrace True \

I am not sure which flag did it (I am pretty sure it is "log_traffic") nor how it affects performance (I am using cuda) but I ran for 10 plus hours with no visual output. After adding these I started getting output for each batch processed. At least with iterative checkpoints being saved by default every 600 seconds (10 minutes) I did not lose my progress. I was not sure everything was running properly till I did this.

crs117 avatar Apr 09 '17 19:04 crs117

@msobhan69 I'm going to close this as inactive

kdavis-mozilla avatar Apr 15 '17 14:04 kdavis-mozilla

I face similar errors but this thread is closed.

  • Download ds2-v2 branch
  • Run ./bin/run-ld93s1.sh
  • Use tensorflow backend The data/ld93s1 has the wave file and csv file.

Messages:

  • [ ! -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=/root/.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 /root/.local/share/deepspeech/ldc93s1 Using TensorFlow backend. W Parameter --validation_step needs to be >0 for early stopping to work Exception in thread Thread-4: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 763, in run self.__target(*self.__args, **self.__kwargs) File "/data/DeepSpeech/util/data_set_helpers.py", line 102, in _populate_batch_queue self._y_length: target_len}) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 789, in run run_metadata_ptr) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 975, in _run % (np_val.shape, subfeed_t.name, str(subfeed_t.get_shape()))) ValueError: Cannot feed value of shape (146, 494) for Tensor u'Placeholder_1:0', which has shape '(?, 26)'

I have tried deepspeech 1 before and the run-ldc93s1.sh works fine. However, when I remove ds1 and use ds2. It is error. What should I set? Thank a lot!


I found several places (DeepSpeech.py and data_set_helpers.py) that DS1 using: numcep + (2 * numcep * numcontext)] DS2 using: numcep

Is it the reason and how to solve (becoz I don't sure change all places or not)

cuhkebook avatar Jul 11 '17 05:07 cuhkebook

@cuhkebook The ds2-v2 is a work in progress it is currently unsupported. The master branch is the only supported branch.

kdavis-mozilla avatar Jul 11 '17 08:07 kdavis-mozilla

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 14:01 lock[bot]