Skip to content
This repository has been archived by the owner on Jul 20, 2022. It is now read-only.

how to train with my own dataset? #11

Closed
Cabbagehust2507 opened this issue Jul 1, 2020 · 2 comments
Closed

how to train with my own dataset? #11

Cabbagehust2507 opened this issue Jul 1, 2020 · 2 comments

Comments

@Cabbagehust2507
Copy link

I have a dataset including many folders, each folder (as a class) contains images. So I want to train with my own dataset but I don't know how to set up my data structure. Thank you so much!

@hysts
Copy link
Owner

hysts commented Jul 1, 2020

Hi, @Cabbagehust2507

I think you can use torchvision.datasets.ImageFolder. You need to modify this file to make your dataset available in this repository. See this part.

If your directory is arranged in exactly the same way as ImageNet, which looks like the following, you can use config files for ImageNet like this without modifying any code. In that case, you need to specify dataset.dataset_dir, dataset.image_size, dataset.n_classes, etc. in the config file, and you need to keep dataset.name as ImageNet.

.
├── train
│   ├── n01440764
│   │   ├── n01440764_10026.JPEG
│   │   ├── n01440764_10027.JPEG
│   │   ├── n01440764_10029.JPEG
...
│   │   └── n01440764_9981.JPEG
│   ├── n01443537
│   │   ├── n01443537_10007.JPEG
│   │   ├── n01443537_10014.JPEG
│   │   ├── n01443537_10025.JPEG

...
│       ├── n15075141_9993.JPEG
│       └── n15075141_999.JPEG
└── val
    ├── n01440764
    │   ├── ILSVRC2012_val_00000293.JPEG
    │   ├── ILSVRC2012_val_00002138.JPEG
    │   ├── ILSVRC2012_val_00003014.JPEG
...

FYI, here is a great repository for image classification. You might want to take a look at it.

@Cabbagehust2507
Copy link
Author

@hysts Thank you so much!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants