Browse Source

update model_name

pull/12/head
liuzx 1 year ago
parent
commit
aea69c2f4d
8 changed files with 14 additions and 14 deletions
  1. +1
    -1
      gcu_mnist_example/README.md
  2. +3
    -3
      gcu_mnist_example/train.py
  3. +1
    -1
      gpgpu_mnist_example/README.md
  4. +1
    -1
      gpgpu_mnist_example/inference.py
  5. +3
    -3
      gpgpu_mnist_example/train.py
  6. +1
    -1
      gpu_mnist_example/README.md
  7. +1
    -1
      gpu_mnist_example/inference.py
  8. +3
    -3
      gpu_mnist_example/train.py

+ 1
- 1
gcu_mnist_example/README.md View File

@@ -23,7 +23,7 @@ Torch_MNIST_Example_Model模型可从本项目的模型目录中引用,[预训
* Torch_MNIST_Example_Model模型的目录结构如下:

> Torch_MNIST_Example_Model
> ├── mnist_epoch1_0.76.pkl
> ├── mnist_epoch1.pkl
>

## 二. 如何在云脑上获取代码路径,数据集路径,预训练模型路径,输出路径


+ 3
- 3
gcu_mnist_example/train.py View File

@@ -13,7 +13,7 @@ If there are Chinese comments in the code,please add at the beginning:

预训练模型文件夹结构是:
Torch_MNIST_Example_Model
├── mnist_epoch1_0.76.pkl
├── mnist_epoch1.pkl

'''

@@ -88,8 +88,8 @@ if __name__ == '__main__':
print('epoch_size is:{}'.format(epochs))

# 如果有保存的模型,则加载模型,并在其基础上继续训练
if os.path.exists(os.path.join(Torch_MNIST_Example_Model_path, "mnist_epoch1_0.76.pkl")):
checkpoint = torch.load(os.path.join(Torch_MNIST_Example_Model_path, "mnist_epoch1_0.76.pkl"))
if os.path.exists(os.path.join(Torch_MNIST_Example_Model_path, "mnist_epoch1.pkl")):
checkpoint = torch.load(os.path.join(Torch_MNIST_Example_Model_path, "mnist_epoch1.pkl"))
model.load_state_dict(checkpoint['model'])
optimizer.load_state_dict(checkpoint['optimizer'])
start_epoch = checkpoint['epoch']


+ 1
- 1
gpgpu_mnist_example/README.md View File

@@ -23,7 +23,7 @@ Torch_MNIST_Example_Model模型可从本项目的模型目录中引用,[预训
* Torch_MNIST_Example_Model模型的目录结构如下:

> Torch_MNIST_Example_Model
> ├── mnist_epoch1_0.76.pkl
> ├── mnist_epoch1.pkl
>

## 二. 如何在云脑上获取代码路径,数据集路径,预训练模型路径,输出路径


+ 1
- 1
gpgpu_mnist_example/inference.py View File

@@ -13,7 +13,7 @@ If there are Chinese comments in the code,please add at the beginning:

预训练模型文件夹结构是:
Torch_MNIST_Example_Model
├── mnist_epoch1_0.76.pkl
├── mnist_epoch1.pkl

'''
from model import Model


+ 3
- 3
gpgpu_mnist_example/train.py View File

@@ -12,7 +12,7 @@ If there are Chinese comments in the code,please add at the beginning:

预训练模型文件夹结构是:
Torch_MNIST_Example_Model
├── mnist_epoch1_0.76.pkl
├── mnist_epoch1.pkl

'''

@@ -99,8 +99,8 @@ if __name__ == '__main__':
test_loader = DataLoader(test_dataset, batch_size=batch_size)

#如果有保存的模型,则加载模型,并在其基础上继续训练
if os.path.exists(os.path.join(Torch_MNIST_Example_Model_path, "mnist_epoch1_0.76.pkl")):
checkpoint = torch.load(os.path.join(Torch_MNIST_Example_Model_path, "mnist_epoch1_0.76.pkl"))
if os.path.exists(os.path.join(Torch_MNIST_Example_Model_path, "mnist_epoch1.pkl")):
checkpoint = torch.load(os.path.join(Torch_MNIST_Example_Model_path, "mnist_epoch1.pkl"))
model.load_state_dict(checkpoint['model'])
optimizer.load_state_dict(checkpoint['optimizer'])
start_epoch = checkpoint['epoch']


+ 1
- 1
gpu_mnist_example/README.md View File

@@ -23,7 +23,7 @@ Torch_MNIST_Example_Model模型可从本项目的模型目录中引用,[预训
* Torch_MNIST_Example_Model模型的目录结构如下:

> Torch_MNIST_Example_Model
> ├── mnist_epoch1_0.76.pkl
> ├── mnist_epoch1.pkl
>

## 二. 如何在云脑上获取代码路径,数据集路径,预训练模型路径,输出路径


+ 1
- 1
gpu_mnist_example/inference.py View File

@@ -13,7 +13,7 @@ If there are Chinese comments in the code,please add at the beginning:

预训练模型文件夹结构是:
Torch_MNIST_Example_Model
├── mnist_epoch1_0.76.pkl
├── mnist_epoch1.pkl

'''
from model import Model


+ 3
- 3
gpu_mnist_example/train.py View File

@@ -12,7 +12,7 @@ If there are Chinese comments in the code,please add at the beginning:

预训练模型文件夹结构是:
Torch_MNIST_Example_Model
├── mnist_epoch1_0.76.pkl
├── mnist_epoch1.pkl

'''

@@ -99,8 +99,8 @@ if __name__ == '__main__':
test_loader = DataLoader(test_dataset, batch_size=batch_size)

#如果有保存的模型,则加载模型,并在其基础上继续训练
if os.path.exists(os.path.join(Torch_MNIST_Example_Model_path, "mnist_epoch1_0.76.pkl")):
checkpoint = torch.load(os.path.join(Torch_MNIST_Example_Model_path, "mnist_epoch1_0.76.pkl"))
if os.path.exists(os.path.join(Torch_MNIST_Example_Model_path, "mnist_epoch1.pkl")):
checkpoint = torch.load(os.path.join(Torch_MNIST_Example_Model_path, "mnist_epoch1.pkl"))
model.load_state_dict(checkpoint['model'])
optimizer.load_state_dict(checkpoint['optimizer'])
start_epoch = checkpoint['epoch']


Loading…
Cancel
Save