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

Which class is predicted? #1

Open
abderhasan opened this issue Aug 16, 2021 · 1 comment
Open

Which class is predicted? #1

abderhasan opened this issue Aug 16, 2021 · 1 comment

Comments

@abderhasan
Copy link

Thanks so much for the nice implementation.

I just have a question about the predicted class.

For instance, I have two classes in two directories: cat and dog. After training the model, I tried to predict the image you had in the test directory, and got the following:

Output Softmax: [[0. 1.]]
This image belongs to class: 1

Which class does 1 refer to in this case?

Thanks.

@bangoc123
Copy link
Owner

bangoc123 commented Aug 26, 2021

Hi @abderhasan.

You can use print('--->', train_ds.class_names) in train.py to list an array of the classes.

The index of a label in that array is corresponding to its class name.

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