diff --git a/gpu_mnist_example/train_gcu.py b/gpu_mnist_example/train_gcu.py index 2dba5f0..81d70a0 100644 --- a/gpu_mnist_example/train_gcu.py +++ b/gpu_mnist_example/train_gcu.py @@ -27,14 +27,11 @@ If there are Chinese comments in the code,please add at the beginning: 示例选用的预训练模型文件为:mnist_epoch1_0.86.pkl - -代码会自动放置在/tmp/code目录下。 -数据集在界面选择后,会自动放置在/tmp/dataset目录下。 -预训练模型文件在界面选择后,会自动放置在/tmp/pretrainmodel目录下。 -输出的模型文件也需要放置在/tmp/output目录下,平台会自动下载/tmp/output目录下的文件。 -如果选用了多数据集,则应在/tmp/dataset后带上数据集名称,比如/tmp/dataset/MnistDataset_torch/train ''' +import os +print("begin:") +os.system("pip install {}".format(os.getenv("OPENI_SDK_PATH"))) import torch from model import Model import numpy as np @@ -44,9 +41,6 @@ from torch.optim import SGD from torch.utils.data import DataLoader from torchvision.transforms import ToTensor import argparse -import os -os.system("pip install {}".format(os.getenv("OPENI_SDK_PATH"))) - from openi.context import prepare, upload_openi import importlib.util