kfallah / manifold-contrastive

Contrastive Learning using Manifold Learning
0 stars 0 forks source link

I had a bug when using my own dataset, maybe you know how to fix it. #1

Open yangzhanpeng9 opened 3 months ago

yangzhanpeng9 commented 3 months ago

Traceback (most recent call last): File "/home/user/Documents/yzp/manifold-contrastive-main/src/experiment.py", line 153, in initialize_experiment run_experiment(cfg, trainer, evaluator, dataset) File "/home/user/Documents/yzp/manifold-contrastive-main/src/experiment.py", line 98, in run_experiment run_eval(epoch, current_best, trainer, evaluator, dataset) File "/home/user/Documents/yzp/manifold-contrastive-main/src/experiment.py", line 70, in run_eval eval_out = evaluator.run_eval(epoch, dataset, last_epoch) File "/home/user/Documents/yzp/manifold-contrastive-main/src/eval/evaluator.py", line 64, in run_eval train_eval_input = encode_features(self.model, eval_dataloader, self.device) File "/home/user/Documents/yzp/manifold-contrastive-main/src/eval/utils.py", line 67, in encode_features x_eval = torch.cat(x_eval) RuntimeError: torch.cat(): expected a non-empty list of Tensors

The structure of my dataset was set like Tiny-Imagenet's.

kfallah commented 2 months ago

Hi, sorry for the delayed response. It seems that the dataset is empty. Could you please give more details on the structure of your folders? Or maybe the config you are using to train?

Tiny-Imagenet is set up as an image folder dataset, in case this link helps: https://pytorch.org/vision/stable/generated/torchvision.datasets.ImageFolder.html