|
|
|
@@ -1,40 +1,33 @@ |
|
|
|
|
|
|
|
# 如何在启智平台上进行模型调试和训练 |
|
|
|
|
|
|
|
## 1. openi的使用方法 |
|
|
|
## 1. c2net的sdk使用方法 |
|
|
|
|
|
|
|
安装openi包 |
|
|
|
安装c2net-beta包 |
|
|
|
|
|
|
|
``` |
|
|
|
pip install -U openi |
|
|
|
``` |
|
|
|
|
|
|
|
若是在智算训练任务中无网络,可以使用以下指令安装 |
|
|
|
|
|
|
|
```text |
|
|
|
import os |
|
|
|
os.system("pip install {}".format(os.getenv("OPENI_SDK_PATH"))) |
|
|
|
pip install -U c2net-beta |
|
|
|
``` |
|
|
|
|
|
|
|
使用openi包 |
|
|
|
使用c2net的SDK方式 |
|
|
|
|
|
|
|
``` |
|
|
|
#导入包 |
|
|
|
from openi.context import prepare, upload_openi |
|
|
|
from c2net.context import prepare, upload_output |
|
|
|
|
|
|
|
#初始化导入数据集和预训练模型到容器内 |
|
|
|
openi_context = prepare() |
|
|
|
c2net_context = prepare() |
|
|
|
|
|
|
|
#获取数据集路径,预训练模型路径,输出路径 |
|
|
|
dataset_path = openi_context.dataset_path |
|
|
|
pretrain_model_path = openi_context.pretrain_model_path |
|
|
|
output_path = openi_context.output_path |
|
|
|
dataset_path = c2net_context.dataset_path |
|
|
|
pretrain_model_path = c2net_context.pretrain_model_path |
|
|
|
output_path = c2net_context.output_path |
|
|
|
|
|
|
|
#回传结果到openi,训练任务才能回传,调试任务回传后也是不支持下载 |
|
|
|
upload_openi() |
|
|
|
upload_output() |
|
|
|
``` |
|
|
|
|
|
|
|
## 2. 手写数字识别示例 |
|
|
|
|
|
|
|
* GPU示例请参考[gpu_mnist_example](./gpu_mnist_example/README.md) |
|
|
|
* NPU示例请参考[npu_mnist_example](./npu_mnist_example/README.md) |
|
|
|
* GCU示例请参考[gcu_mnist_example](./gcu_mnist_example/README.md) |