Closed Wiikk closed 4 years ago
Hey I have exactly the same problem how did you manage to solve it?
@MichalisLazarou You can write a new class called "RotatedNonEpisodicMiniImagenetPkl" imitating "RotatedNonEpisodicMiniImagenet" in src/datasets/miniimagenet.py. This works for me.
Thanks @Wiikk! Would you mind doing a pull request to include it in the repo?
@prlz77 Sure, I will do this later.
Thank you :)
Hi, thanks for your excellent work. I use the pickled version of mini-imagenet dataset and set the dataset name "episodic_miniimagenet_pkl". However, when I run the pre-training code, I get the following error message:
Traceback (most recent call last): File "trainval.py", line 220, in
pretrained_weights_dir=args.pretrained_weights_dir)
File "trainval.py", line 143, in trainval
score_dict.update(model.train_on_loader(train_loader))
File "/remote-home/my/Code/embedding-propagation-master/src/models/pretraining.py", line 172, in train_on_loader
for batch_idx, batch in enumerate(data_loader):
return {key: default_collate([d[key] for d in batch]) for key in elem}
File "/usr/local/miniconda3/envs/dl10/lib/python3.6/site-packages/torch/utils/data/_utils/collate.py", line 82, in default_collate
raise TypeError(default_collate_err_msg_format.format(elem_type))
TypeError: default_collate: batch must contain tensors, numpy arrays, numbers, dicts or lists; found <class 'NoneType'>
File "/usr/local/miniconda3/envs/dl10/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 346, in next data = self.dataset_fetcher.fetch(index) # may raise StopIteration File "/usr/local/miniconda3/envs/dl10/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 47, in fetch return self.collate_fn(data) File "/usr/local/miniconda3/envs/dl10/lib/python3.6/site-packages/torch/utils/data/_utils/collate.py", line 75, in default_collate return {key: default_collate([d[key] for d in batch]) for key in elem} File "/usr/local/miniconda3/envs/dl10/lib/python3.6/site-packages/torch/utils/data/_utils/collate.py", line 75, in
Could you give some advice on dealing with NoneType values? Thanks a lot.