MindSpore-Model-Development/examples
Xunhui Zhang 6567b93c30 update instructions of the challenge 2023-04-18 15:43:37 +08:00
..
scripts update instructions of the challenge 2023-04-18 15:43:37 +08:00
README.md update instructions of the challenge 2023-04-18 15:43:37 +08:00
finetune.py update instructions of the challenge 2023-04-18 15:43:37 +08:00
train_parallel_with_func_example.py update instructions of the challenge 2023-04-18 15:43:37 +08:00
train_with_func_example.py update instructions of the challenge 2023-04-18 15:43:37 +08:00

README.md

This folder contains examples for various tasks, which users can run easily.

Finetune

python examples/finetune.py

This example shows how to finetune a pretrained model on your own dataset. You can also specifiy --freeze_backbone to choose whether to freeze the backbone and finetune the classifier head only.

Single process with model training and evaluation

python examples/train_with_func_example.py

This example shows how to train and evaluate a model on your own dataset.

Multiprocess with model training and evaluation

export CUDA_VISIBLE_DEVICES=0,1,2,3  # suppose there are 4 GPUs
mpirun --allow-run-as-root -n 4 python examples/train_parallel_with_func_example.py

This example shows how to train and evaluate a mode with multiprocess on your own dataset on GPU.