[英]How to use pickled pretrained weights in Tensorflow 2?
I'm trying to load a pkl file that was generated in a model trained with tensorflow 1.x in tf2.我正在尝试加载在 tf2 中使用 tensorflow 1.x 训练的 model 中生成的 pkl 文件。
model.load_weights(checkpoint_path)
does not seem to work. model.load_weights(checkpoint_path)
似乎不起作用。 any suggestions?有什么建议么?
Try loading the pickle file then get the weights.尝试加载泡菜文件然后获取权重。
import pickle
import tensorflow as tf
model = pickle.loads('<path>')
loaded_model = model.get_weights()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.