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

The specified path cannot be found #41

Open
zhanglaoban-kk opened this issue Sep 18, 2023 · 10 comments
Open

The specified path cannot be found #41

zhanglaoban-kk opened this issue Sep 18, 2023 · 10 comments

Comments

@zhanglaoban-kk
Copy link

Hello, I want to load my own unlabeled image data for pre-training, modify the parser.add_argument in the main_pretrain.py('--data_path', default='./data/imagenet', type=str, help='dataset path'), why the system prompts that the specified path cannot be found. Should the image data be divided according to the training set, validation set, and test set?

@LTH14
Copy link
Owner

LTH14 commented Sep 18, 2023

It should follow the same structure as ImageNet data, with train/class_name/images.png and val/class_name/images.png

@zhanglaoban-kk
Copy link
Author

Hello, if I want to use mage for self-supervised learning, pre-train with unlabeled image data, and then load pre-trained weights for labeled data image classification, what should I do?

@LTH14
Copy link
Owner

LTH14 commented Sep 19, 2023

My suggestion is to replace the default ImageNet dataloader with your own dataloader. Once that is done, you can use the unlabeled image data with main_pretrain.py and use the labeled data with main_finetune.py

@zhanglaoban-kk
Copy link
Author

Hello, I also have a question, you used the labeled imagenet dataset for pre-training, and then finetune, is there no data leakage in this, because during the pre-training, you use labeled data?

@LTH14
Copy link
Owner

LTH14 commented Nov 18, 2023

We only use the ImageNet images and never use the label information during pre-training.

@zhanglaoban-kk
Copy link
Author

Is it pre-trained using only the images in the training and validation sets of the imagenet image dataset? What is the purpose of a validation set?

@LTH14
Copy link
Owner

LTH14 commented Nov 18, 2023

It only uses training set.

@zhanglaoban-kk
Copy link
Author

As you said above, if I want to use my own unlabeled image data for pre-training, your suggestion is to replace the dataloader of imagenet, where should I modify the dataloader?

@LTH14
Copy link
Owner

LTH14 commented Nov 18, 2023

Change the dataset here to your customized dataset implementation https://github.com/LTH14/mage/blob/main/main_pretrain.py#L122

@zhanglaoban-kk
Copy link
Author

Ok, thanks for the reply, I already understand

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