在使用平台的一段时间后,发现有一点小问题,就是可能系统还未完善,训练完成后,不支持下载整个训练结果文件夹,这对我们这样的小白非常苦恼,经过老师指点后,就添加了一个函数到自己的代码中,从而可以实现自动将训练结果打包成压缩包,下载训练结果也就非常方便了。
以在智算网络集群运行yolov5为例。首先,得修改train.py文件,因为train.py文件是启动yolov5的主要文件,首先要确保--project参数设置成正确的输出路径:
然后寻找存储目录的变量,经过全局搜索发现变量在yolov5/train.py寻找发现存储目录的变量名为opt.save_dir,通过opt.name也可以确定其为存储目录的变量:
接着返回yolov5/train.py,在头文件添加zipfile:
添加压缩文件夹函数ZipDir:
在main函数调用函数,注意是在最后调用,也就是主程序执行完后调用,原始路径名为opt.save_dir:
可以先选择1个epochs测试训练结果文件夹打包功能,有错误可以及时修改。
总结来说,就是修改路径,然后寻找算法里面的主程序文件,接着寻找存储目录的变量名,一般是有dir后缀,然后添加压缩文件夹函数,最后在main函数里面进行调用。
最后感谢社区平台提供的免费算力资源,以及老师们的悉心指点,我也会尽我所能为平台出一份力,祝平台发展的越来越好!!
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》