deeplearning4j:更新保存的模型

时间:2018-09-19 10:09:45

标签: java deep-learning deeplearning4j

我在数据的第一部分使用deeplearning4j训练了一个模型并将其保存。

ModelSerializer.writeModel(model, locationToSave, true);

现在,我想在数据的下一部分上训练此保存的模型。

我加载了模型:

MultiLayerNetwork model = ModelSerializer.restoreMultiLayerNetwork("location");

然后我习惯在新数据上对其进行训练

model.fit(trainingDataIt);

但是该模型似乎不合适,因为我看不到每次迭代的状态

11:56:56.161 [ADSI prefetch thread] DEBUG o.n.l.memory.abstracts.Nd4jWorkspace - Steps: 4
11:59:30.072 [main] DEBUG o.d.d.iterator.AsyncDataSetIterator - Manually destroying ADSI workspace
11:59:30.123 [ADSI prefetch thread] DEBUG o.n.l.memory.abstracts.Nd4jWorkspace - Steps: 4
12:01:39.760 [main] DEBUG o.d.d.iterator.AsyncDataSetIterator - Manually destroying ADSI workspace
12:01:39.793 [ADSI prefetch thread] DEBUG o.n.l.memory.abstracts.Nd4jWorkspace - Steps: 4
12:03:46.496 [main] DEBUG o.d.d.iterator.AsyncDataSetIterator - Manually destroying ADSI workspace
12:03:46.551 [ADSI prefetch thread] DEBUG o.n.l.memory.abstracts.Nd4jWorkspace - Steps: 4

这是正常现象,还是我的方法有问题?

1 个答案:

答案 0 :(得分:0)

您只需要调用ModelSerializer.writeModel 加载并调用fit之后。