handwriting-generation icon indicating copy to clipboard operation
handwriting-generation copied to clipboard

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

Open quasayush opened this issue 3 years ago • 2 comments

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

quasayush avatar Apr 03 '21 09:04 quasayush

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

pcsingh avatar May 26 '21 05:05 pcsingh

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.

ShubhamKumar2802 avatar May 01 '22 13:05 ShubhamKumar2802