Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
|
|
5 years ago | |
|---|---|---|
| .. | ||
| README.md | 5 years ago | |
| config.py | 5 years ago | |
| dataset.py | 5 years ago | |
| eval.py | 5 years ago | |
| generator_lr.py | 5 years ago | |
| train.py | 5 years ago | |
Training AlexNet with CIFAR-10 dataset in MindSpore.
This is the simple tutorial for training AlexNet in MindSpore.
Install MindSpore.
Download the CIFAR-10 dataset, the directory structure is as follows:
├─cifar-10-batches-bin
│
└─cifar-10-verify-bin
# train AlexNet, hyperparameter setting in config.py
python train.py --data_path cifar-10-batches-bin
You will get the loss value of each step as following:
epoch: 1 step: 1, loss is 2.2791853
...
epoch: 1 step: 1536, loss is 1.9366643
epoch: 1 step: 1537, loss is 1.6983616
epoch: 1 step: 1538, loss is 1.0221305
...
Then, evaluate AlexNet according to network model
# evaluate AlexNet, 1 epoch training accuracy is up to 51.1%; 10 epoch training accuracy is up to 81.2%
python eval.py --data_path cifar-10-verify-bin --mode test --ckpt_path checkpoint_alexnet-1_1562.ckpt
Here are some optional parameters:
--device_target {Ascend,GPU}
device where the code will be implemented (default: Ascend)
--data_path DATA_PATH
path where the dataset is saved
--dataset_sink_mode DATASET_SINK_MODE
dataset_sink_mode is False or True
You can run python train.py -h or python eval.py -h to get more information.
MindSpore is a new open source deep learning training/inference framework that could be used for mobile, edge and cloud scenarios.
C++ Python Text Unity3D Asset C other