skynbe / pseudo-attributes

Official implementation of BPA (CVPR 2022)
12 stars 2 forks source link

Something wrong about image resize #1

Closed Genhajime closed 2 years ago

Genhajime commented 2 years ago

Thank you for your great work!\ I tried to run "Quick Start", and got the following error. Would you please fix this bug?

Traceback (most recent call last):
  File "./pseudo-attributes/main.py", line 156, in <module>
    main()
  File "./pseudo-attributes/main.py", line 149, in main
    trainer.test_unbiased(epoch=epoch)
  File "./pseudo-attributes/trainer.py", line 234, in test_unbiased
    for data, target, biases, group, _, _, ids in test_bar:
  File "./miniconda3/envs/pseudo/lib/python3.10/site-packages/tqdm/std.py", line 1195, in __iter__
    for obj in iterable:
  File "./miniconda3/envs/pseudo/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 652, in __next__
    data = self._next_data()
  File "./miniconda3/envs/pseudo/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1347, in _next_data
    return self._process_data(data)
  File "./miniconda3/envs/pseudo/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1373, in _process_data
    data.reraise()
  File "./miniconda3/envs/pseudo/lib/python3.10/site-packages/torch/_utils.py", line 461, in reraise
    raise exception
RuntimeError: Caught RuntimeError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "./miniconda3/envs/pseudo/lib/python3.10/site-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop
    data = fetcher.fetch(index)
  File "./miniconda3/envs/pseudo/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 52, in fetch
    return self.collate_fn(data)
  File "./miniconda3/envs/pseudo/lib/python3.10/site-packages/torch/utils/data/_utils/collate.py", line 175, in default_collate
    return [default_collate(samples) for samples in transposed]  # Backwards compatibility.
  File "./miniconda3/envs/pseudo/lib/python3.10/site-packages/torch/utils/data/_utils/collate.py", line 175, in <listcomp>
    return [default_collate(samples) for samples in transposed]  # Backwards compatibility.
  File "./miniconda3/envs/pseudo/lib/python3.10/site-packages/torch/utils/data/_utils/collate.py", line 140, in default_collate
    out = elem.new(storage).resize_(len(batch), *list(elem.size()))
RuntimeError: Trying to resize storage that is not resizable
skynbe commented 2 years ago

Hi, did you download celebA dataset at ${ROOT_PATH}/data/celebA? The directory should contain

./data/celebA
 └──img_align_celeba/
 └──list_attr_celeba.csv
 └──list_attr_celeba.txt
 └──list_eval_partition.csv
 └──list_eval_partition.txt
Genhajime commented 2 years ago

I appreciate your reply!

Actually, as downloading torchvision.datasets.CelebA is currently unavailable, I downloaded the data from the google drive directly. (https://drive.google.com/drive/folders/0B7EVK8r0v71pWEZsZE9oNnFzTm8?resourcekey=0-5BR16BdXnb8hVj6CNHKzLg) There are no celeba/ or *.csv in their folder, so I'm wondering how to get them.

skynbe commented 2 years ago

Please download the files from these two links:

https://www.kaggle.com/datasets/jessicali9530/celeba-dataset https://graal.ift.ulaval.ca/public/celeba/

(I found celeba/ folder is not required.)

Genhajime commented 2 years ago

All right, now the code works, thank you!

By the way, I have one more question. Could you tell me which epoch's model was used for the reported test accuracy on the paper?\ Just after whole training, or decided by validation accuracy?

skynbe commented 2 years ago

We selected the final model based on the validation accuracy.