问题描述:
通过SummaryRecord模块生成summary日志文件
【操作步骤&问题现象】
1、环境:使用计算中心的ModelArts,在昇腾上对mindspore模型进行训练;
2、代码:参考文档(https://www.mindspore.cn/mindinsight/docs/zh-CN/r1.6/summary_record.html?highlight=summary)中第三种方式记录数据;
在def epoch_end()函数中使用self.summary_record.add_value添加需要记录的数据。其中,自定义Callback见附件,训练脚本中相关代码如下:
3、目前运行完一个epoch后,没有找到日志文件,请问是什么问题?
解答:
在ModelArts上训练生成的文件,需要用moxing拷贝,moxing的使用请参考https://support.huaweicloud.com/moxing-devg-modelarts/modelarts_11_0005.html
import moxing
训练完成后,moxing.file.copy_parallel("./summary_dir", "obs://mindspore/xxx/summary_dir")