Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
|
|
5 years ago | |
|---|---|---|
| .. | ||
| imagenet | 5 years ago | |
| template | 5 years ago | |
| README.md | 5 years ago | |
| run_imagenet.sh | 5 years ago | |
| run_template.sh | 5 years ago | |
| writer.py | 5 years ago | |
This example provides an efficient way to generate MindRecord. Users only need to define the parallel granularity of training data reading and the data reading function of a single task. That is, they can efficiently convert the user's training data into MindRecord.
Download and prepare the ImageNet dataset as required.
Store the downloaded ImageNet dataset in a folder. The folder contains all images and a mapping file that records labels of the images.
In the mapping file, there are three columns, which are separated by spaces. They indicate image classes, label IDs, and label names. The following is an example of the mapping file:
n02119789 1 pen
n02100735 2 notbook
n02110185 3 mouse
n02096294 4 orange
Edit run_imagenet.sh and modify the parameters
Run the bash script
bash run_imagenet.sh
Performance result
| Training Data | General API | Current Example | Env |
|---|---|---|---|
| ImageNet(140G) | 2h40m | 50m | CPU: Intel Xeon Gold 6130 x 64, Memory: 256G, Storage: HDD |
Assume the dataset name is 'xyz'
cd ${your_mindspore_home}/example/convert_to_mindrecord
cp -r template xyz
Edit dictionary data generator
cd ${your_mindspore_home}/example/convert_to_mindrecord
vi xyz/mr_api.py
Two API, 'mindrecord_task_number' and 'mindrecord_dict_data', must be implemented
Tricky for parallel run
cd ${your_mindspore_home}/example/convert_to_mindrecord
python writer.py --mindrecord_script xyz [...]
You can put this command in script run_xyz.sh for easy execution
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