Grzego / handwriting-generation

Implementation of handwriting generation with use of recurrent neural networks in tensorflow. Based on Alex Graves paper (https://arxiv.org/abs/1308.0850).
MIT License
520 stars 107 forks source link

Error - "Cannot convert a symbolic Tensor to a numpy array" while running train.py #26

Open quasayush opened 3 years ago

quasayush commented 3 years ago

Greetings Sir Thank a lot for providing such a nice implementation. However, I was facing some issues while implementing the code. First of all in new numpy version allow_pickle is False by default so I solved one of the error by using allow_pickle=True in np.load statements in batch_generator.py

However, while trying to run train.py I am getting an error "NotImplementedError: Cannot convert a symbolic Tensor (model/rnn_1/while/rnn/rnn_model/window/add_1:0) to a numpy array."

2

This is same error I am getting while trying to use pretrained model

I am using Tensorflow 1.15.2 and numpy 1.19.5 and running on Google Colab

pcsingh commented 3 years ago

Hi @quasayush Replace the np.square with tf.math.square and it will solve the issue. It worked for me.

ShubhamKumar2802 commented 2 years ago

Hi @quasayush Replace the np.square with tf.math.square and it will solve the issue. It worked for me.

Hey @pcsingh I've made the changes you mentioned but the code still throws the same error for me.