You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 1.3 kB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # AlexNet Example
  2. ## Description
  3. Training AlexNet with dataset in MindSpore.
  4. This is the simple tutorial for training AlexNet in MindSpore.
  5. ## Requirements
  6. - Install [MindSpore](https://www.mindspore.cn/install/en).
  7. - Download the dataset, the directory structure is as follows:
  8. ```
  9. ├─10-batches-bin
  10. └─10-verify-bin
  11. ```
  12. ## Running the example
  13. ```python
  14. # train AlexNet, hyperparameter setting in config.py
  15. python train.py --data_path 10-batches-bin
  16. ```
  17. You will get the loss value of each step as following:
  18. ```bash
  19. epoch: 1 step: 1, loss is 2.2791853
  20. ...
  21. epoch: 1 step: 1536, loss is 1.9366643
  22. epoch: 1 step: 1537, loss is 1.6983616
  23. epoch: 1 step: 1538, loss is 1.0221305
  24. ...
  25. ```
  26. Then, evaluate AlexNet according to network model
  27. ```python
  28. # evaluate AlexNet
  29. python eval.py --data_path 10-verify-bin --ckpt_path checkpoint_alexnet-1_1562.ckpt
  30. ```
  31. ## Note
  32. Here are some optional parameters:
  33. ```bash
  34. --device_target {Ascend,GPU}
  35. device where the code will be implemented (default: Ascend)
  36. --data_path DATA_PATH
  37. path where the dataset is saved
  38. --dataset_sink_mode DATASET_SINK_MODE
  39. dataset_sink_mode is False or True
  40. ```
  41. You can run ```python train.py -h``` or ```python eval.py -h``` to get more information.