cydonia999/VGGFace2-pytorch

Wrong number of classes in validation

IdanAzuri opened this issue · 4 comments

Hi,
I took the train/test CSV files from here vggface2 meta and when I try to test the model (or validate) it crashes in the loss criteria. I think it causes because the number of classes in the test set should equal to the training set. So, I wondered if no one complains about it - if there is something else that I can do.

Thanks!

Hi,
Even I tried testing the model with the following command
python demo.py test --arch_type senet50_ft --weight senet50_ft_weight.pkl --dataset_dir test/ --test_img_list_file test_list.txt --meta_file identity_meta.csv
and it crashes with the following error:
File "/data/VGGFace2-pytorch/trainer.py", line 92, in validate
if np.isnan(float(loss.data[0])):
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number.

Did you get a similar error and how did you resolve the same?

Thank you!

I have the same problem,did you solve it ?

i have the same question.
why the the labels of the test dataset is different from the labels of the train dataset?

I think the thing is there is no overlap between training set and test set. Labels of training set vary from 0 to 8612 and 0 to 499 for test set. While you are testing, there are still 8613 classes in the output layer.