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

How to use my own dataset to train my model? #1

Open
hefei1019 opened this issue Jun 12, 2021 · 2 comments
Open

How to use my own dataset to train my model? #1

hefei1019 opened this issue Jun 12, 2021 · 2 comments

Comments

@hefei1019
Copy link

Hi, I am a student who learning incremental learning. I have use this code to train cifar-100 dataset, now I want to train my own dataset by this model. I meet some problem, can you tell me how to change this code to make it to be suitable for my dataset which is .mat form and it is necessary to divide the dataset to train and test file? Thanks for you reading, and I will expect you reply.

@lrzpellegrini
Copy link
Owner

lrzpellegrini commented Jun 16, 2021

Hi @hefei1019, I never worked with .mat files, but it should be easy to load and convert them to PyTorch Tensors (see https://discuss.pytorch.org/t/how-to-read-a-dataset-in-mat-form-in-pytorch/71668/2).

The dataset must be split in train and test sets before creating the NCProtocol:

protocol = NCProtocol(CIFAR100('./data/cifar100', train=True, download=True, transform=transform),

Another thing you may want to change is the model (https://github.com/lrzpellegrini/icarl-pytorch/blob/master/models/icarl_net.py), which currently comes with some hard-coded dimensions which are specific to CIFAR.

Consider that this code is very specific for the CIFAR dataset and may not work with other datasets in general. I recommend using the implementation found in the Avalanche framework which is more stable and flexible: https://github.com/ContinualAI/avalanche/blob/master/examples/icarl.py

@hefei1019
Copy link
Author

hefei1019 commented Jun 18, 2021 via email

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

No branches or pull requests

2 participants