【问题标题】:MXnet fine-tune save modelMXnet微调保存模型
【发布时间】:2017-06-13 14:16:14
【问题描述】:

我正在使用 mxnet 的微调示例通过以下代码微调我自己的数据:

https://github.com/dmlc/mxnet/blob/master/example/image-classification/fine-tune.py

通过查看 common/fit.py,我不知道如何在微调时保存临时模型。

例如,我想每 5000 次迭代保存 .params 文件,我该怎么做? 谢了!

【问题讨论】:

    标签: mxnet


    【解决方案1】:

    http://mxnet.io/api/python/callback.html

    尝试使用 mx.callback API。

    module.fit(iterator, num_epoch=n_epoch,
    ... epoch_end_callback  = mx.callback.do_checkpoint("mymodel", 1))
    Start training with [cpu(0)]
    Epoch[0] Resetting Data Iterator
    Epoch[0] Time cost=0.100
    Saved checkpoint to "mymodel-0001.params"
    Epoch[1] Resetting Data Iterator
    Epoch[1] Time cost=0.060
    Saved checkpoint to "mymodel-0002.params"
    

    【讨论】:

      猜你喜欢
      • 2020-04-07
      • 1970-01-01
      • 2018-07-05
      • 2021-10-06
      • 1970-01-01
      • 2021-04-04
      • 2016-09-24
      • 2023-03-30
      • 2019-06-16
      相关资源
      最近更新 更多