Deleting a branch is permanent. It CANNOT be undone. Continue?
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》
按照教程的方式通过moxing来保存数据,同步的文件夹为"/home/work/user-job-dir/outputs/model/",日志上输出成功,但结果下载选项是空的。
结果下载中,模型的下载需要通过train_url将训练镜像的内容同步到obs中,启智平台才会提供下载。具体代码可参考示例。
从截图看日志,你的代码中是将训练镜像的内容同步到训练镜像的另一个文件夹了。可以按照以下代码进行修改:
###Copy the output model to obs###
def EnvToObs(train_dir, obs_train_url):
try:
mox.file.copy_parallel(train_dir, obs_train_url)
print("Successfully Upload {} to {}".format(train_dir,obs_train_url))
except Exception as e:
print('moxing upload {} to {} failed: '.format(train_dir,obs_train_url) + str(e))
return
###Copy the trained model data from the local running environment back to obs,
###and download it in the training task corresponding to the Qizhi platform
parser.add_argument('--train_url',
help='model folder to save/load',
default= WorkEnvironment('train') + '/model/')
train_dir = workroot + '/model'
args = parser.parse_args()
EnvToObs(train_dir, args.train_url)
结果下载没有内容,估计是没有把生成的训练结果拷贝回obs吧
建议先设置一个文件夹用来保存训练结果,训练代码那部分只能训练结果保存到前面设置的文件夹中,最后使用mox将训练结果复制到train_url这样结果查看那边就应该会有训练好的文件了。
代码示例
方法WorkEnvironment未定义,无法正确找到路径
Defines whether the task is a training environment or a debugging environment
def WorkEnvironment(environment):
if environment == 'train':
workroot = '/home/work/user-job-dir'
elif environment == 'debug':
workroot = '/home/work'
print('current work mode:' + environment + ', workroot:' + workroot)
return workroot
可参考示例代码https://git.openi.org.cn/OpenIOSSG/MNIST_Example/src/branch/master/train.py
修改之后依然无法下载
请检查下代码逻辑是否是将/model下的内容上传到obs,上传成功的路径如下: