aimagelab / VKD

PyTorch code for ECCV 2020 paper: "Robust Re-Identification by Multiple Views Knowledge Distillation"
MIT License
73 stars 15 forks source link

Error on training: stack expects a non-empty TensorList #23

Closed Perry0rnitorincul closed 1 year ago

Perry0rnitorincul commented 2 years ago

Hello, I am trying to reproduce the results on Google Collab. I followed the instructions, but maybe I have mistaken something: I have all the needed files on a Google Drive and, therefore, the datasets structure looks like this: VKD-master/datasets/mars and there are 3 folders (info, bbox_train, bbox_test). However, when I start running the training command, I get the following error: "RuntimeError: stack expects a non-empty TensorList" I have attached a file of the entire log. Also, when I tried on the pre-trained model, the same error occurred. Any change I do, brings me back to this same error. Please, guide me towards a solution. Any idea is welcomed. Thank you, Anca error_lic path_lic

angpo commented 2 years ago

I guess that it's a problem due to wrong paths. The code assumes that the datasets' tree is placed in the current working directory. Therefore, please check if VKD-master is being set as your current working directory within the notebook environment.

Perry0rnitorincul commented 2 years ago

I have configured the absolute path in the colab notebook enviroment. Also, to be sure, I have added the path in every .py file (attached a photo). Still, when hitting the train command I get the same error. This is the link from the notebook env.: https://colab.research.google.com/drive/1sPZJIyUXNiFfzdzSkgltY4OvrgE7BOY-?usp=sharing I have added there a "tree" command so you can visualize how the project structure looks like, but I skipped the bbox_train/bbox_test directories because of their large files. However, the folders are where specified, under the /datasets/mars directory. Could you please have a look? Maybe you notice something. I really do not know what else to change. Many Thanks! image

angpo commented 2 years ago

I have performed the command as you did, but the error does not show. I would suggest modifying the code as follows, to check if it's about wrong paths:

`

def main(): conf = Conf() args = parse(conf) device = conf.get_device()

conf.suppress_random(set_determinism=args.set_determinism)
saver = Saver(conf.log_path, args.exp_name)

#nas_path = conf.nas_path
nas_path = "/absolute/path/to/the/dir/containing/the/mars/"
# e.g. /nas/user/datasets and not /nas/user/datasets/mars

train_loader, query_loader, gallery_loader, queryimg_loader, galleryimg_loader = \
    get_dataloaders(args.dataset_name, nas_path, device, args)

num_pids = train_loader.dataset.get_num_pids()

`

Perry0rnitorincul commented 2 years ago

Thank you for checking my code. I do really appreciate it! Unfortunately, I tried with your suggestion and I am still having the same error. I tried with the previous version of code (original code) and printed the conf.nas_path and it is: /content/drive/My Drive/Licenta/VKD/datasets (attached photo). I also took the installations again one by one with all the prerequisites (I think in the beginning I was not having the right version of conda). Do you know, what else could be checked...? Thank you, again! image

angpo commented 2 years ago

Ok, please email me at angelo.porrello@unimore.it and let's solve the issue together.