Giter Club home page Giter Club logo

tensorflow-rnn-ctc's Introduction

TensorFlow RNN CTC Build Status

Connectionist Temporal Classification (CTC) by using Recurrent Neural Network (RNN) in TensorFlow.

Requirements

  • Python 2.7+ (for Linux)
  • Python 3.5+ (for Windows)
  • TensorFlow 1.12.1+
  • NumPy 1.5+
  • SciPy 0.12+
  • python_speech_features 0.1+

Installation

I suggest you to use Anaconda. For TensorFlow and python_speech_features use pip:

$ activate anaconda_env_name
(anaconda_env_name)$ pip install python_speech_features
(anaconda_env_name)$ pip install --ignore-installed --upgrade tensorflow # without GPU
(anaconda_env_name)$ pip install --ignore-installed --upgrade tensorflow-gpu # with GPU

Training

Run training by using train.py file.

python train.py

License

This project is licensed under the terms of the MIT license.

tensorflow-rnn-ctc's People

Contributors

edvinas01 avatar ugnelis avatar vishichoudhary avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tensorflow-rnn-ctc's Issues

No valid path found

when I replaced the data set with mine, I get this error:

2018-02-07 20:56:16.459860: W C:\tf_jenkins\home\workspace\rel-win\M\windows\PY\36\tensorflow\core\util\ctc\ctc_loss_calculator.cc:144] No valid path found.
2018-02-07 20:56:16.461720: W C:\tf_jenkins\home\workspace\rel-win\M\windows\PY\36\tensorflow\core\util\ctc\ctc_loss_calculator.cc:144] No valid path found.
2018-02-07 20:56:16.465147: W C:\tf_jenkins\home\workspace\rel-win\M\windows\PY\36\tensorflow\core\util\ctc\ctc_loss_calculator.cc:144] No valid path found.
2018-02-07 20:56:16.466100: W C:\tf_jenkins\home\workspace\rel-win\M\windows\PY\36\tensorflow\core\util\ctc\ctc_loss_calculator.cc:144] No valid path found.
2018-02-07 20:56:16.488530: W C:\tf_jenkins\home\workspace\rel-win\M\windows\PY\36\tensorflow\core\util\ctc\ctc_loss_calculator.cc:144] No valid path found.

what is the issue?

Make utils file

Separate train.py functions which can be use also elsewhere, and make utils file.

How to use the saved model?

Got this info. at the end of the training:
2020-01-16 04:49:00,021 - root - INFO - Model saved in file: ./models/model.ckpt
I0116 04:49:00.021643 140352211462016 train.py:241] Model saved in file: ./models/model.ckpt

How to use the saved model for testing a .wav file? Is the code for testing the model already available?

Add tests for the functions

Add tests for train.py function:

  • read_text_file
  • make_char_array
  • normalize_text
  • sparse_tuples_from_sequences
  • read_audio_files
  • read_text_files
  • sequence_decoder
  • texts_encoder
  • standardize_audios
  • get_sequence_lengths
  • make_sequences_same_length

Giving error on increasing number of layers?

`Traceback (most recent call last):
File "C:\Python36\lib\site-packages\tensorflow\python\framework\common_shapes.py", line 686, in _cal
l_cpp_shape_fn_impl
input_tensors_as_shapes, status)
File "C:\Python36\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 473, in __exit
__
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: Dimensions must be equal, but are 100 an
d 63 for 'rnn/while/rnn/multi_rnn_cell/cell_0/cell_0/lstm_cell/MatMul_1' (op: 'MatMul') with input sha
pes: [?,100], [63,200].

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "train.py", line 244, in
tf.app.run()
File "C:\Python36\lib\site-packages\tensorflow\python\platform\app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "train.py", line 111, in main
outputs, _ = tf.nn.dynamic_rnn(stack, inputs_placeholder, sequence_length_placeholder, dtype=tf.fl
oat32)
File "C:\Python36\lib\site-packages\tensorflow\python\ops\rnn.py", line 614, in dynamic_rnn
dtype=dtype)
File "C:\Python36\lib\site-packages\tensorflow\python\ops\rnn.py", line 777, in dynamic_rnn_loop
swap_memory=swap_memory)
File "C:\Python36\lib\site-packages\tensorflow\python\ops\control_flow_ops.py", line 2816, in while

loop
result = loop_context.BuildLoop(cond, body, loop_vars, shape_invariants)
File "C:\Python36\lib\site-packages\tensorflow\python\ops\control_flow_ops.py", line 2640, in BuildL
oop
pred, body, original_loop_vars, loop_vars, shape_invariants)
File "C:\Python36\lib\site-packages\tensorflow\python\ops\control_flow_ops.py", line 2590, in _Build
Loop
body_result = body(*packed_vars_for_body)
File "C:\Python36\lib\site-packages\tensorflow\python\ops\rnn.py", line 760, in _time_step
skip_conditionals=True)
File "C:\Python36\lib\site-packages\tensorflow\python\ops\rnn.py", line 236, in _rnn_step
new_output, new_state = call_cell()
File "C:\Python36\lib\site-packages\tensorflow\python\ops\rnn.py", line 748, in
call_cell = lambda: cell(input_t, state)
File "C:\Python36\lib\site-packages\tensorflow\python\ops\rnn_cell_impl.py", line 183, in call
return super(RNNCell, self).call(inputs, state)
File "C:\Python36\lib\site-packages\tensorflow\python\layers\base.py", line 575, in call
outputs = self.call(inputs, *args, **kwargs)
File "C:\Python36\lib\site-packages\tensorflow\python\ops\rnn_cell_impl.py", line 1066, in call
cur_inp, new_state = cell(cur_inp, cur_state)
File "C:\Python36\lib\site-packages\tensorflow\python\ops\rnn_cell_impl.py", line 183, in call
return super(RNNCell, self).call(inputs, state)
File "C:\Python36\lib\site-packages\tensorflow\python\layers\base.py", line 575, in call
outputs = self.call(inputs, *args, **kwargs)
File "C:\Python36\lib\site-packages\tensorflow\python\ops\rnn_cell_impl.py", line 611, in call
lstm_matrix = self._linear1([inputs, m_prev])
File "C:\Python36\lib\site-packages\tensorflow\python\ops\rnn_cell_impl.py", line 1189, in call
res = math_ops.matmul(array_ops.concat(args, 1), self._weights)
File "C:\Python36\lib\site-packages\tensorflow\python\ops\math_ops.py", line 1891, in matmul
a, b, transpose_a=transpose_a, transpose_b=transpose_b, name=name)
File "C:\Python36\lib\site-packages\tensorflow\python\ops\gen_math_ops.py", line 2436, in _mat_mul
name=name)
File "C:\Python36\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 787, in _ap
ply_op_helper
op_def=op_def)
File "C:\Python36\lib\site-packages\tensorflow\python\framework\ops.py", line 2958, in create_op
set_shapes_for_outputs(ret)
File "C:\Python36\lib\site-packages\tensorflow\python\framework\ops.py", line 2209, in set_shapes_fo
r_outputs
shapes = shape_func(op)
File "C:\Python36\lib\site-packages\tensorflow\python\framework\ops.py", line 2159, in call_with_req
uiring
return call_cpp_shape_fn(op, require_shape_fn=True)
File "C:\Python36\lib\site-packages\tensorflow\python\framework\common_shapes.py", line 627, in call
_cpp_shape_fn
require_shape_fn)
File "C:\Python36\lib\site-packages\tensorflow\python\framework\common_shapes.py", line 691, in _cal
l_cpp_shape_fn_impl
raise ValueError(err.message)
ValueError: Dimensions must be equal, but are 100 and 63 for 'rnn/while/rnn/multi_rnn_cell/cell_0/cell
_0/lstm_cell/MatMul_1' (op: 'MatMul') with input shapes: [?,100], [63,200].`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.