dssm模型保存报错
Describe the question(问题描述) 使用下面命令训练并保存模型,报ValueError: Unable to save the object ListWrapper([<tensorflow.python.keras.layers.core.Activation object at 0x7f1a301de5e0>, <tensorflow.python.keras.layers.core.Activation object at 0x7f1b88dc48b0>]) (a list wrapper constructed to track trackable TensorFlow objects). A list element was replaced (setitem, setslice), deleted (delitem, delslice), or moved (sort). In order to support restoration on object creation, tracking is exclusively for append-only data structures.
callbacks = [
tf.keras.callbacks.ModelCheckpoint(best_model_dir, monitor='val_loss', save_best_only=True),
]
model.fit(train_data, validation_data=valid_data, epochs=2, callbacks=callbacks)
Operating environment(运行环境):
- python version [3.8]
- tensorflow version [2.5.0]
- deepmatch version [0.3.0]
您好,请问解决了吗,我这样保存也是同样的错误
from tensorflow.python.keras.models import save_model
save_model(model, './model', save_format='tf')
您好,请问解决了吗,我这样保存也是同样的错误
from tensorflow.python.keras.models import save_model save_model(model, './model', save_format='tf')
你在线上推理时并不需要这个模型,你只要把user emb和item emb的模型保存下来就可以了。
您好,请问解决了吗,我这样保存也是同样的错误
from tensorflow.python.keras.models import save_model save_model(model, './model', save_format='tf')你在线上推理时并不需要这个模型,你只要把user emb和item emb的模型保存下来就可以了。
求一个代码