layumi / Person_reID_baseline_pytorch

:bouncing_ball_person: Pytorch ReID: A tiny, friendly, strong pytorch implement of person re-id / vehicle re-id baseline. Tutorial 👉https://github.com/layumi/Person_reID_baseline_pytorch/tree/master/tutorial
https://www.zdzheng.xyz
MIT License
4.14k stars 1.01k forks source link

Couldn't find any class folder in /content/drive/MyDrive/Person_reID_baseline_pytorch/Market-1501-v15.09.15/pytorch/query #375

Open MetehanYasar11 opened 1 year ago

MetehanYasar11 commented 1 year ago

After I train the model with tutorial dataset, I tried to run this command below in colab;

!python test.py --gpu_ids 0 --name ft_ResNet50 --batchsize 32 --which_epoch 59 --test_dir /content/drive/MyDrive/Person_reID_baseline_pytorch/Market-1501-v15.09.15/pytorch

and I get this error;

This is not an error. If you want to use low precision, i.e., fp16, please install the apex with cuda support (https://github.com/NVIDIA/apex) and update pytorch to 1.0 We use the scale: 1 Traceback (most recent call last): File "/content/drive/MyDrive/Person_reID_baseline_pytorch/test.py", line 146, in image_datasets = {x: datasets.ImageFolder( os.path.join(data_dir,x) ,data_transforms) for x in ['gallery','query']} File "/content/drive/MyDrive/Person_reID_baseline_pytorch/test.py", line 146, in image_datasets = {x: datasets.ImageFolder( os.path.join(data_dir,x) ,data_transforms) for x in ['gallery','query']} File "/usr/local/lib/python3.10/dist-packages/torchvision/datasets/folder.py", line 309, in init super().init( File "/usr/local/lib/python3.10/dist-packages/torchvision/datasets/folder.py", line 144, in init classes, class_to_idx = self.find_classes(self.root) File "/usr/local/lib/python3.10/dist-packages/torchvision/datasets/folder.py", line 218, in find_classes return find_classes(directory) File "/usr/local/lib/python3.10/dist-packages/torchvision/datasets/folder.py", line 42, in find_classes raise FileNotFoundError(f"Couldn't find any class folder in {directory}.") FileNotFoundError: Couldn't find any class folder in /content/drive/MyDrive/Person_reID_baseline_pytorch/Market-1501-v15.09.15/pytorch/query.

When I look into /content/drive/MyDrive/Person_reID_baseline_pytorch/Market-1501-v15.09.15/pytorch/query, there is nothing...

layumi commented 1 year ago

Hi @MetehanYasar11 Do you download the dataset? and successfully use prepare.py to make sub-folders?

MetehanYasar11 commented 1 year ago

Hi @MetehanYasar11 Do you download the dataset? and successfully use prepare.py to make sub-folders?

Yes, I have downloaded dataset and and executed succesfully prepare.py and train.py

layumi commented 1 year ago

Hi @MetehanYasar11 Ok. Is it good with Person_reID_baseline_pytorch/Market-1501-v15.09.15/pytorch/train and gallery?