ageron / ageron/handson-ml2

[Chapter 16] - Saving the Encocer-Decoder Inference Model

Ouverte
#256 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Jupyter Notebook
Étoiles
30k
Forks
13.1k
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

Hi to all,

I just wondered whether or not there is an easy way to save the inference model from the third and fourth version of the seq2seq example.

Using a simple inference_model.save() will return with an error:

> AssertionError: Tried to export a function which references untracked object Tensor("10865:0", shape=(), dtype=resource).TensorFlow objects (e.g. tf.Variable) captured by functions must be tracked by assigning them to an attribute of a tracked object or assigned to an attribute of the main object directly.

This is connected to the GreedyEmbeddingSampler. And yes, I tried to find a solution already, but nothing seems to work. Besides, I got the feeling that I am missing an important point here.

I know, that I always can save the training model and reconstruct the inference model from its weights during runtime. But this seems cumbersome.

Anybody got any ideas?

And sorry, if this is not the right channel to ask this question.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.