HowToTrainYourMAMLPytorch
HowToTrainYourMAMLPytorch copied to clipboard
AttributeError: 'list' object has no attribute 'keys'
Traceback (most recent call last):
File "train_maml_system.py", line 14, in <module>
maml_system = ExperimentBuilder(model=model, data=data, args=args, device=device)
File "/workspace/assign_3/HowToTrainYourMAMLPytorch/experiment_builder.py", line 53, in __init__
self.data = data(args=args, current_iter=self.state['current_iter'])
File "/workspace/assign_3/HowToTrainYourMAMLPytorch/data.py", line 569, in __init__
self.dataset = FewShotLearningDatasetParallel(args=args)
File "/workspace/assign_3/HowToTrainYourMAMLPytorch/data.py", line 159, in __init__
"train": {key: len(self.datasets['train'][key]) for key in list(self.datasets['train'].keys())},
AttributeError: 'list' object has no attribute 'keys'
i am getting this error for mini imagenet dataset
I am really sorry about this. I recently applied some quick refactoring suggested by sourcery. I checked the changed but it seems this one escaped my attention. I'll resolve this shortly.
Thanks a lot.
Can you give it a try now?
I am hoping that 86964701651c06e490271365fedb8789a72ef3f0 fixes it.
No, I think line 159 in data.py also needs to be changed.
Is this alright now? I triple checked and it runs fine on my local machine.
I think I find the reason.
Please check whether your mini_imagenet_full_size.json
is correct.
It would become {}
if you did not put the dataset in correct place at the first time you run the script.
Hope this will help!
I have the same problem. Is that right to place file mini_imagenet_full_size.tar.bz2 under the folder 'datasets'? Is there other parameters needed to be modified?
I solved my problem as follows. First, automatic unzip code didn't work for my testing, so I unzip the file in terminal manually. Then I deleted the json file for miniimagenet in folder 'dataset'. Then it works.