LearningToCompare_FSL icon indicating copy to clipboard operation
LearningToCompare_FSL copied to clipboard

self.train_labels = [labels[self.get_class(x)] for x in self.train_roots] KeyError: '..\\datas\\omniglot_28x28'

Open Samlezed opened this issue 3 years ago • 4 comments

self.train_labels = [labels[self.get_class(x)] for x in self.train_roots] KeyError: '..\datas\omniglot_28x28'

Samlezed avatar Oct 10 '21 06:10 Samlezed

I'm getting a similar problem. I get KeyError: '(Dataset folder directory)' just like you, for both Omniglot and miniImagenet. Could you solve it? @Samlezed

KhanShovon avatar Jul 20 '22 08:07 KhanShovon

i get this error too

gaoyangyang-1 avatar Dec 14 '22 00:12 gaoyangyang-1

you can change the code like this:

from: task_generator.py, line 74:   def get_class(self, sample): return os.path.join(*sample.split('/')[:-1])

to: def get_class(self, sample): return os.path.join(*sample.split('\')[:-1])

gaoyangyang-1 avatar Dec 14 '22 01:12 gaoyangyang-1

Thank you for your reply. I've solved it following the solution I found on a Chinese forum. That was lifesaving!

KhanShovon avatar Dec 14 '22 15:12 KhanShovon