Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
liuzx ce2e65ec3b | 6 months ago | |
---|---|---|
.. | ||
README.md | 6 months ago | |
inference.py | 7 months ago | |
model.py | 1 year ago | |
train.py | 7 months ago |
数据集可从本项目的数据集中引用,数据集引用
MnistDataset_torch数据集是由10类28∗28的灰度图片组成,训练数据集包含60000张图片,测试数据集包含10000张图片。
MnistDataset_torch.zip数据集压缩包的目录结构如下:
MnistDataset_torch.zip
├── test
└── train
Torch_MNIST_Example_Model模型可从本项目的模型目录中引用,预训练模型引用
Torch_MNIST_Example_Model模型的目录结构如下:
Torch_MNIST_Example_Model
├── mnist_epoch1.pkl
表1创建训练作业界面参数说明
参数名称 | 说明 |
---|---|
代码分支 | 选择仓库代码中要使用的代码分支,默认可选择master分支 |
镜像 | 镜像选择含有python和torch的镜像,推荐镜像: |
启动文件 | 启动文件选择代码目录下的启动脚本,在本示例中选择gpu_mnist_example/train.py |
数据集 | 数据集选择MnistDataset_torch.zip |
运行参数 | 选择增加运行参数可以向脚本中其他参数传值,如epoch_size,需要在代码里定义增加的超参数 |
资源规格 | 规格选择[GPU] |
模型 | 模型选择Torch_MNIST_Example_Model |
启动调试任务后,先执行prepare()进行数据准备;
进入对应的代码目录后,可在终端执行python train.py;
表2 创建训练作业界面参数说明
参数名称 | 说明 |
---|---|
代码分支 | 选择仓库代码中要使用的代码分支,默认可选择master分支 |
镜像 | 镜像选择含有python和torch的镜像 |
启动文件 | 启动文件选择代码目录下的启动脚本,在本示例中选择gpu_mnist_example/train.py |
数据集 | 数据集选择MnistDataset_torch.zip |
运行参数 | 选择增加运行参数可以向脚本中其他参数传值,如epoch_size,需要在代码里定义增加的超参数 |
资源规格 | 规格选择[GPU] |
模型 | 模型选择Torch_MNIST_Example_Model |
启动训练任务后,训练结束会在任务的结果下载页提供输出结果下载
from c2net.context import prepare
c2net_context = prepare()
code_path = c2net_context.code_path +"/" +"项目名".lower()
在本示例中代码路径为:
code_path = c2net_context.code_path + "/" + "Openl_Cloudbrain_Example".lower()
dataset_path = c2net_context.dataset_path +"/" +"数据集名称"
在本示例中代码路径为:
dataset_path = c2net_context.dataset_path + "/" + "MnistDataset_torch"
pretrain_model_path = c2net_context.pretrain_model_path +"/" +"模型名称"
在本示例中预训练模型路径为:
pretrain_model_path = c2net_context.pretrain_model_path + "/" + "Torch_MNIST_Example_Model"
output_path = c2net_context.output_path
在本示例中输出路径为:
output_path = c2net_context.output_path
from c2net.context import upload_output
upload_output()
在本示例中回传结果为(只有训练任务才能回传结果):
from c2net.context import prepare,upload_output
upload_output()
请在代码中加入
import parser
args, unknown = parser.parse_known_args()
#可忽略掉 `--ckpt_url`,`--data_url`, `--multi_date_url`等参数无定义导致的报错问题
本项目存放了利用启智云脑完成手写数字识别相关的任务,旨在为AI开发者提供云脑调试、训练和推理任务的示例。
Python
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》