thanks for your nice work!
I tried to reproduce the results on iNaturalist and SOP with a 32G V100. But I met the same error in the evaluation phase.
The error information is as follows:
[2023-03-31 09:27:57,441][PML][INFO] - Computing accuracy for the test split w.r.t ['test']
Traceback (most recent call last):
File "roadmap/single_experiment_runner.py", line 66, in single_experiment_runner
checkpoint_dir=resume,
File "/home/yangjian/retrieval/ROADMAP-main/roadmap/run.py", line 154, in run
restore_epoch=restore_epoch,
File "/home/yangjian/retrieval/ROADMAP-main/roadmap/engine/train.py", line 100, in train
**dataset_dict,
File "/home/yangjian/retrieval/ROADMAP-main/roadmap/utils/get_set_random_state.py", line 32, in wrapper
output = func(*args, **kwargs)
File "/home/yangjian/retrieval/ROADMAP-main/roadmap/engine/evaluate.py", line 145, in evaluate
splits_to_eval=splits_to_eval,
File "/home/yangjian/anaconda3/envs/roadmap/lib/python3.7/site-packages/pytorch_metric_learning/testers/base_tester.py", line 307, in test
reference_split_names,
File "/home/yangjian/anaconda3/envs/roadmap/lib/python3.7/site-packages/pytorch_metric_learning/testers/global_embedding_space.py", line 26, in do_knn_and_accuracies
self.ref_includes_query(query_split_name, reference_split_names),
File "/home/yangjian/retrieval/ROADMAP-main/roadmap/engine/accuracy_calculator.py", line 140, in get_accuracy
query_labels, reference_labels, self.label_comparison_fn,
File "/home/yangjian/anaconda3/envs/roadmap/lib/python3.7/site-packages/pytorch_metric_learning/utils/accuracy_calculator.py", line 153, in get_label_match_counts
comparison = unique_query_labels[:, None] == reference_labels
RuntimeError: The size of tensor a (512) must match the size of tensor b (60502) at non-singleton dimension 2
I have printed the 'query_labels' and 'reference_labels':
query_labels: tensor([[-0.0357, -0.0059, -0.0690, ..., -0.0238, -0.0273, 0.0572],
[-0.0684, 0.0068, -0.0903, ..., -0.0357, 0.0095, 0.0314],
[-0.0661, -0.0320, -0.0592, ..., 0.0084, -0.0471, 0.0413],
...,
[-0.0183, -0.0594, -0.0730, ..., 0.0730, 0.0116, 0.0096],
[ 0.0094, -0.0630, -0.0917, ..., 0.1146, -0.0042, 0.0074],
[ 0.0019, -0.0335, -0.0428, ..., 0.0115, -0.0445, 0.0971]],
device='cuda:0') torch.Size([136093, 512])
reference_labels: tensor([716, 716, 716, ..., 810, 810, 810], device='cuda:0') torch.Size([136093])
Could you please help us find out the possible reasons?