LeelaChessZero / lczero-training

For code etc relating to the network training process.
143 stars 119 forks source link

Model cannot be saved in a saved model format #207

Closed Kovax007 closed 2 years ago

Kovax007 commented 2 years ago

Loading the tfprocess.py with a yaml, than using the model.save('somepath') or either tf.keras.models.save_model() function does not work and return with the error: TypeError: Unable to serialize 0.319471538066864 to JSON. Unrecognized type <class 'tensorflow.python.framework.ops.EagerTensor'>.

Kovax007 commented 2 years ago

Issue is when usign tf.cast to calculate any parameter, that it wants to create with the keras.metadatafile, converting the values with float() or using numpy solves the issue. as tf.cast creates EagerTensor object