我在处理Tensorflow中的一个推理模型问题。我已经用定制对象的字典(一个特定的度量)从SavedModel加载了它。我已经建立了一个推理模型,并给出了一个原始字符串的张量,但是我收到了这个错误:
FailedPreconditionError: Exception encountered when calling layer "string_lookup" (type StringLookup).
Table not initialized. [Op:LookupTableFindV2]因此,我终于用这个不推荐的方法(tensorflow 2.7)初始化了表:
tf.compat.v1.initialize_all_tables(name='init_all_tables')就像你想象的那样,它不起作用。
所以我在亚喷气机link1 link2 link3上找到了那些票
我的问题是:在加载用于推理建模之前,是否需要使用遗留init选项的特定命令保存模型?
发布于 2021-12-16 13:01:53
我的模型没有集成vectorize_layer的适应步骤。有必要将其具体化。
因此,为了恢复我的模型并使用它进行推理,解决方案只是简单地重新加载我的模型,并在同一列车文本数据上重新读取vector_layer。
https://stackoverflow.com/questions/70377255
复制相似问题