[英]when to call compile while training a tensorflow (2.0) model in incremental fashion?
我正在编写一个神经网络来进行增量训练(不是在线)。 这是代码片段
output = create_model()
model = Model(inputs=values, outputs=output)
if start_epoch > 1:
weights_list = load_model_from_pickle()
model.set_weights(weights_list)
model.compile(loss='binary_crossentropy', optimizer='adam')
model.fit(data , label, epochs=1, verbose=1, batch_size=1024, shuffle=False)
本质上,我想加载之前训练的权重并训练更多的 epoch。 我读了一些 SO 回复说调用 compile 会改变权重? 还有其他方法吗? 调用编译后设置权重有意义吗? 如果我在多 gpu 设置中运行我的 model,答案会改变吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.