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

getting an error while training GoogleNet on custom dataset #25

Closed
mmitchef opened this issue Jun 5, 2022 · 2 comments
Closed

getting an error while training GoogleNet on custom dataset #25

mmitchef opened this issue Jun 5, 2022 · 2 comments

Comments

@mmitchef
Copy link

mmitchef commented Jun 5, 2022

Thanks for sharing your code. I ran your code on ellipse and rectangle and it worked but when I ran it on my own dataset ( Labeled Faced in the Wild-LFW) I get the below error:
Total 7804 images, split into 1000 classes
Classes:
{'Aaron_Peirsol': 0, 'Abdoulaye_Wade': 1, 'Abdullah': 2, 'Abdullah_Gul': 3, 'Abdullah_al-Attiyah': 4, 'Abel_Pacheco': 5, 'Abid_Hamid_Mahmud_Al-Tikriti': 6, 'Adam_Sandler': 7,$
Traceback (most recent call last):
File "dream-creator-master/train_googlenet.py", line 171, in
main()
File dream-creator-master/train_googlenet.py", line 51, in main
main_func(params)
File "dream-creator-master/train_googlenet.py", line 65, in main_func
training_data, num_classes, class_weights = load_dataset(data_path=params.data_path, val_percent=params.val_percent, batch_size=params.batch_size,
File "dream-creator-master/utils/training_utils.py", line 85, in load_dataset
train_weights = [1 / train_class_counts[class_id] for class_id in range(num_classes)]
File "dream-creator-master/utils/training_utils.py", line 85, in
train_weights = [1 / train_class_counts[class_id] for class_id in range(num_classes)]
KeyError: 169

Do you have any idea how I can solve it, thanks.

@mmitchef
Copy link
Author

mmitchef commented Jun 6, 2022

I could solve the problem. I had some identities with 2 samples that after splitting the dataset into train and validation there wasn't any samples inside of validation and it cause the problem. So, we need to make sure to have enough sample to split it into 80%-20% (train-validation)

@mmitchef mmitchef closed this as completed Jun 6, 2022
@ProGamerGov
Copy link
Owner

@mmitchef Thanks for sharing your solution for others!

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