baidu-research / ba-dls-deepspeech

Apache License 2.0
486 stars 174 forks source link

TypeError(('TensorType does not support iteration. ' #12

Closed homink closed 7 years ago

homink commented 7 years ago

Hello

I am new to machine learning and love to experiment deepspeech. Thanks for letting me use this. I have encountered the following error and would like ask some help.

I have installed all dependencies and have switched to the Theano backend. Nothing more than these has been changed nor configured. I found that the type running in the iteration loop of _tensor_py_operatiors is <class 'theano.tensor.sharedvar.TensorSharedVariable'>. I have no idea why this is not <class 'theano.tensor.var.TensorVariable'>. Could anyone take a look?

Thanks in advance,

$ python train.py train_corpus.json validation_corpus.json ./model Using Theano backend. 2016-12-28 16:43:14,243 INFO (data_generator) Reading description file: train_corpus.json for partition: train 2016-12-28 16:43:14,366 INFO (data_generator) Reading description file: validation_corpus.json for partition: validation 2016-12-28 16:43:15,157 INFO (model) Building gru model 2016-12-28 16:43:16,010 INFO (model) Building train_fn Traceback (most recent call last): File "train.py", line 155, in args.sortagrad) File "train.py", line 126, in main train_fn = compile_train_fn(model) File "/home/devling/kwon/theano_exp/ba-dls-deepspeech/model.py", line 51, in compile_train_fn updates=updates) File "/usr/local/lib/python2.7/dist-packages/Keras-1.2.0-py2.7.egg/keras/backend/theano_backend.py", line 960, in function return Function(inputs, outputs, updates=updates, **kwargs) File "/usr/local/lib/python2.7/dist-packages/Keras-1.2.0-py2.7.egg/keras/backend/theano_backend.py", line 939, in init for v, nv in updates: File "/usr/local/lib/python2.7/dist-packages/Theano-0.9.0dev4-py2.7.egg/theano/tensor/var.py", line 596, in iter raise TypeError(('TensorType does not support iteration. ' TypeError: TensorType does not support iteration. Maybe you are using builtin.sum instead of theano.tensor.sum? (Maybe .max?)

homink commented 7 years ago

The following helped me out. :)

pip install Keras==1.1.0