问题描述
我正在尝试保存 GPflow 模型(在 GPflow 2.0 版中).
I am trying to save a GPflow model (in GPflow version 2.0).
model = gpflow.models.VGP((X, Y_data), kernel=kernel, likelihood=likelihood, num_latent_gps=1)
由于 gpflow
软件包不再具有 saver
模块,有人可以用另一种方法来帮助我吗?
Since the gpflow
package no longer has a saver
module, could anyone help me with an alternative way?
推荐答案
保存GPflow模型的方法有很多,而具体方法取决于您的用例.您可以使用TensorFlow的检查点(保存经过训练的权重)或使用TensorFlow的SavedModel格式(保存权重和计算图的一部分).您可以在简介中看到这两种方法的示例到GPflow2笔记本.
There are different ways of saving a GPflow model and the way to do it will depend on your use-case. You can either use TensorFlow's checkpointing (saving the trained weights) or use TensorFlow's SavedModel format (saving weights and parts of the computational graph). You can see examples of both approaches in the intro to GPflow2 notebook.
这篇关于将模型保存在gpflow 2中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!