Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add tutorials of fine-tune on a custom dataset #711

Merged
merged 3 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 51 additions & 49 deletions benchmark_results.md

Large diffs are not rendered by default.

359 changes: 359 additions & 0 deletions docs/en/how_to_guides/finetune_with_a_custom_dataset.md

Large diffs are not rendered by default.

365 changes: 365 additions & 0 deletions docs/zh/how_to_guides/finetune_with_a_custom_dataset.md

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
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
Expand Down
108 changes: 0 additions & 108 deletions examples/finetune.py

This file was deleted.

17 changes: 17 additions & 0 deletions examples/finetune/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
This folder contains scripts for fine-tuning on your own custom dataset, do refer to [tutorials](https://mindspore-lab.github.io/mindcv/how_to_guides/finetune_with_a_custom_dataset/) for details.

### split_files.py
```shell
python examples/finetune/split_files.py
```
This file taking Aircraft dataset as an example, shows how to manually reorganize data into a tree-structure directory according to an annotation file. Note that it's only for Aircraft dataset but not a general one, you'd better check the content before running it.

### read_images_online.py

This is an example demonstrating how to read the raw images as well as the labels into a `GeneratorDataset` object, which is a `MappableDataset` class that can be read directly by models. You are recommended to insert this part into your data preprocessing script or training script, but not run it alone.

### finetune.py
```shell
python examples/finetune/finetune.py --config=./configs/mobilenetv3/mobilnet_v3_small_ascend.yaml
```
A script for fine-tuning with some example code of fine-tuning methods in it (refer to the tutorial mentioned above).
Loading