DeepSpeech icon indicating copy to clipboard operation
DeepSpeech copied to clipboard

E Checkpoint directory (/path_system/.local/share/deepspeech/ldc93s1) does not contain a valid checkpoint state

Open darius1tanz opened this issue 7 years ago • 12 comments

system Info- Intel© Core™ i7-8700K CPU @ 3.70GHz GPU:- 2070 RTX 8GB RAM:- 32 GiB OS:- Linux Mint 19.1 Cinnamon tensorflow gpu version == 1.13.1

Everything working fine but got Following Error also i check in this (/system_path/.local/share/deepspeech/ldc93s1) directory there is no previous checkpoints i don't know why this error occur please help me:-

WARNING:tensorflow:From /home/gpu1/tmp/deepspeech-venv/lib/python3.6/site-packages/tensorflow/contrib/rnn/python/ops/lstm_ops.py:696: to_int64 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version. Instructions for updating: I Initializing variables... I STARTING Optimization I Training epoch 0... 2019-04-06 04:11:00.963684: E tensorflow/stream_executor/cuda/cuda_dnn.cc:334] Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR 2019-04-06 04:11:00.968836: E tensorflow/stream_executor/cuda/cuda_dnn.cc:334] Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR

darius1tanz avatar Apr 06 '19 07:04 darius1tanz

I have a similar issue. Trying to train without any checkpoints with a script that worked previously. The error is a log out from the evaluate.py file. The call expects checkpoint DIR but the saver saves nothing so exit code. I tried with the 0.4.1 checkpoints just to see if that worked but got the same result. I think it's expecting checkpoints for model training not necessarily fine tuning. But I could be wrong.

tuttlebr avatar Apr 07 '19 14:04 tuttlebr

FYI the cudnn error is unrelated to what I'm seeing. Do you have the correct nvidia driver + cuda + cudnn combo for tensorflow 1.13.1?

tuttlebr avatar Apr 07 '19 14:04 tuttlebr

system Info- Intel© Core™ i7-8700K CPU @ 3.70GHz GPU:- 2070 RTX 8GB RAM:- 32 GiB OS:- Linux Mint 19.1 Cinnamon tensorflow gpu version == 1.13.1

Everything working fine but got Following Error also i check in this (/system_path/.local/share/deepspeech/ldc93s1) directory there is no previous checkpoints i don't know why this error occur please help me:-

WARNING:tensorflow:From /home/gpu1/tmp/deepspeech-venv/lib/python3.6/site-packages/tensorflow/contrib/rnn/python/ops/lstm_ops.py:696: to_int64 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version. Instructions for updating: I Initializing variables... I STARTING Optimization I Training epoch 0... 2019-04-06 04:11:00.963684: E tensorflow/stream_executor/cuda/cuda_dnn.cc:334] Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR 2019-04-06 04:11:00.968836: E tensorflow/stream_executor/cuda/cuda_dnn.cc:334] Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR

I see several errors here, can you be more specific ? I can't understand your current state. So far, if your training fails with CUDNN_STATUS_INTERNAL_ERROR it means your setup is wrong and it's expected there's no checkpoint created ...

lissyx avatar Apr 08 '19 11:04 lissyx

I'm having the error stated in the OPs title, not a cuDNN error. In reading the flags.py file in more detail, there is a new flag. The default is auto, which attempts to figure out what I want given the contents in the directory provided. If I set this to 'init' the exit code persists, training stops.

I've also tried various combinations/omissions of checkpoint_dir, and fine_tuning_checkpints, all have same issue.

Input: running a shell script with my hyperparameters

#!/bin/bash

set -xe
if [ ! -f DeepSpeech.py ]; then
    echo "Assert: Hi. Please run this from deepSpeech top level directory."
    exit 1
fi;

python3 -u DeepSpeech.py \
  --train_files '/audiodata/bucket1/AudioData/Utterances/valid-train.csv' \
  --dev_files '/audiodata/bucket1/AudioData/Utterances/valid-dev.csv' \
  --test_files '/audiodata/bucket1/AudioData/Utterances/valid-test.csv' \
  --train_batch_size 64 \
  --dev_batch_size 48 \
  --test_batch_size 48 \
  --epochs 75 \
  --dropout_rate .1 \
  --learning_rate 0.0001 \
  --export_dir '/audiodata/bucket1/AudioData/Utterances/SpeechModel/' \
  --alphabet_config_path '/audiodata/bucket1/AudioData/Utterances/SpeechModel/alphabet.txt' \
  --lm_binary_path '/audiodata/bucket1/AudioData/Utterances/SpeechModel/lm.binary' \
  --lm_trie_path '/audiodata/bucket1/AudioData/Utterances/SpeechModel/trie' \
  --report_count 10 \
  "$@"

output from console:

+ '[' '!' -f DeepSpeech.py ']'
+ python3 -u DeepSpeech.py --train_files /audiodata/bucket1/AudioData/Utterances/valid-train.csv --dev_files /audiodata/bucket1/AudioData/Utterances/valid-dev.csv --test_files /audiodata/bucket1/AudioData/Utterances/valid-test.csv --train_batch_size 64 --dev_batch_size 48 --test_batch_size 48 --epochs 25 --dropout_rate .1 --learning_rate 0.00001 --export_dir /audiodata/bucket1/AudioData/Utterances/SpeechModel/ --checkpoint_dir /audiodata/bucket1/AudioData/Utterances/SpeechModel/checkpoints/ --alphabet_config_path /audiodata/bucket1/AudioData/Utterances/SpeechModel/alphabet.txt --lm_binary_path /audiodata/bucket1/AudioData/Utterances/SpeechModel/lm.binary --lm_trie_path /audiodata/bucket1/AudioData/Utterances/SpeechModel/trie --report_count 10
I Initializing variables...
I STARTING Optimization
I Training epoch 0...
E Checkpoint directory (/audiodata/bucket1/AudioData/Utterances/SpeechModel/checkpoints/) does not contain a valid checkpoint state.
  0% (1 of 1604) |                       | Elapsed Time: 0:00:05 ETA:   2:18:24

tuttlebr avatar Apr 08 '19 16:04 tuttlebr

@tuttlebr You don't specify any checkpoint directory, so the default one applies and should be $HOME/.local/share/deepspeech/ldc93s1/

lissyx avatar Apr 08 '19 17:04 lissyx

If you're trying to fine tune our release checkpoints, they're no longer compatible with master code due to a recent refactoring to remove distributed training. Try specifying an empty checkpoint_dir (and training from scratch), or downgrade the code to an older version.

reuben avatar Apr 08 '19 17:04 reuben

Thank you for the fast response! Your team is amazing! :)

I am not trying to retrain or restart. Every combination I've tried returns the exit(1) from the evaluate.py file. Combinations I've tried --checkpoint_dir 'some/custom/path_to_empty/folder/

#ommit --checkpoint_dir and allow xdg to decide, also double checked this dir was empty.

--checkpoint_dir 'some/custom/path_to_0.4.1_checkpoint_files/folder/

It looks the tf.saver isn't saving anything. And if I tried to run checkpoints incorrectly, wouldn't I trigger this from DeepSpeech.py: log_error('Unable to load %s model from specified checkpoint dir' ' - consider using load option "auto" or "init".' % FLAGS.load)

Looks like I can't make it past line 473 in DeepSpeech.py:

_, current_step, batch_loss, step_summary = \ session.run([train_op, global_step, loss, step_summaries_op], feed_dict=feed_dict)

tuttlebr avatar Apr 08 '19 17:04 tuttlebr

The tf.train.Coordinator.stop_on_exception() context manager is swallowing the underlying problem here, try removing it to see what is actually causing things to fail (fixed in #2023).

reuben avatar Apr 08 '19 21:04 reuben

Ah-ha! It ended up being the output > input error thrown by the ctc loss function. For now, i'll just change to ignore_longer_outputs_than_inputs=True.

InvalidArgumentError (see above for traceback): Not enough time for target transition sequence (required: 5, available: 4)3You can turn this error into a warning by using the flag ignore_longer_outputs_than_inputs [[node tower_0/CTCLoss (defined at DeepSpeech.py:188) = CTCLoss[ctc_merge_repeated=true, ignore_longer_outputs_than_inputs=false, preprocess_collapse_repeated=false, _device="/job:localhost/replica:0/task:0/device:CPU:0"](tower_0/raw_logits/_89, tower_0/DeserializeSparse, tower_0/DeserializeSparse:1, tower_0/IteratorGetNext:1)]] [[{{node Mean_8/_145}} = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_714_Mean_8", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]]

I have a check for this if others experience it, but I'm pretty sure the gradient is set to 0 if this error occurs and is ignored. It uses components from your old preprocessing.py file. Unfortunately, after changing line 188 to total_loss = tf.nn.ctc_loss(labels=batch_y, inputs=logits, sequence_length=batch_seq_len, ignore_longer_outputs_than_inputs=True)

def map_is_this_bad_audio(audio_filename, transcript):
        r"""
        A simple audio validation process to determine if an audio sample may be a good candidate 
        for CTC loss given audio represented as MFCC and transcript represented as vector. Poor
        audio will also be removed by determining the decibel level averages across the audio file.
        """
        try:
            features_len = len(audiofile_to_input_vector(audio_filename, numcep=26, numcontext=9)) - 2 * 9 #features_len
            transcript_len = len(text_to_char_array(transcript, alphabet_))
            if features_len < transcript_len:
                answer = "CTCError"
            elif features_len <= 1:
                answer = "TransLen<=1"
            else:
                q = pydub.AudioSegment.from_wav(audio_filename)
                if str(q.dBFS) == '-inf':
                    answer = 'dBFS-inf'
                elif q.split_to_mono()[0].max <= 500:
                    answer = "LowAmplitude"
                else:
                    answer = "OK"
        except:
            answer = "FileError"
        return answer


def is_this_bad_audio(dataframe):
    r"""star map function which takes a df
    Input: df[0] as a list of string file paths to .wav and df[1] as a ground truth transcription.
    Output: list of QC results of each files evaluation."""

    array = np.asarray(dataframe)
    AUTOTUNE = multiprocessing.cpu_count()

    data = [(wav_filename, transcript) for wav_filename, transcript in array]
               
    with multiprocessing.Pool(AUTOTUNE) as p:
        qc = p.starmap(map_is_this_bad_audio, data)
    return qc

tuttlebr avatar Apr 08 '19 23:04 tuttlebr

If you're trying to fine tune our release checkpoints, they're no longer compatible with master code due to a recent refactoring to remove distributed training. Try specifying an empty checkpoint_dir (and training from scratch), or downgrade the code to an older version.

So, this means that the 0.4.1 checkpoint no longer works if you want to use it for additional training? About when will there be a compatible version if so?

20richardh avatar May 15 '19 01:05 20richardh

So, this means that the 0.4.1 checkpoint no longer works if you want to use it for additional training? About when will there be a compatible version if so?

That's done now.

lissyx avatar Jun 14 '19 09:06 lissyx

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 Jul 14 '19 10:07 lock[bot]