Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nus_wide dataset problem #24

Closed
yhhhli opened this issue Jan 11, 2019 · 3 comments
Closed

nus_wide dataset problem #24

yhhhli opened this issue Jan 11, 2019 · 3 comments

Comments

@yhhhli
Copy link

yhhhli commented Jan 11, 2019

Hi, I followed the instructions in the markdown file, but i got some problem with the nus_wide dataset.

I noticed that you changed the directory ./data/nus_wide to .data/nuswide_81, so I change the code in train.py

elif config["dataset"] == "nus_wide":
    config["data"] = {"train_set1": {"list_path": "../data/nuswide_81/train.txt", "batch_size": 36}, \
                      "train_set2": {"list_path": "../data/nuswide_81/train.txt", "batch_size": 36}}

And when I run the train.py using the following command:

python train.py --gpu_id 0 --dataset nus_wide --prefix resnet50_hashnet --hash_bit 48 --net ResNet50 --lr 0.0003 --class_num 1.0

There is a no such file error:

  File "train.py", line 279, in <module>
    train(config)
  File "train.py", line 199, in train
    inputs1, labels1 = iter1.next()
  File "/home/yuhang/anaconda3/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 286, in __next__
    return self._process_next_batch(batch)
  File "/home/yuhang/anaconda3/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 307, in _process_next_batch
    raise batch.exc_type(batch.exc_msg)
FileNotFoundError: Traceback (most recent call last):
  File "/home/yuhang/anaconda3/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 57, in _worker_loop
    samples = collate_fn([dataset[i] for i in batch_indices])
  File "/home/yuhang/anaconda3/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 57, in <listcomp>
    samples = collate_fn([dataset[i] for i in batch_indices])
  File "/tmp/liyuhang/Hashnet/src/data_list.py", line 89, in __getitem__
    img = self.loader(path)
  File "/tmp/liyuhang/Hashnet/src/data_list.py", line 45, in default_loader
    return pil_loader(path)
  File "/tmp/liyuhang/Hashnet/src/data_list.py", line 26, in pil_loader
    with open(path, 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: './data/nuswide_81/images/93478_2084149655_e5049606da_m.jpg'

And when I run it another time, it says another jpg that do not exist in images directory. However, I'm sure those jpg are in the images directory. Could you please help me fix that? Thank you!

And I use pytorch 0.4.0, would that be the reason?

@yhhhli yhhhli closed this as completed Jan 11, 2019
@caozhangjie
Copy link
Collaborator

You may check the directory you running the code. It needs to be the . in ./data

@yhhhli
Copy link
Author

yhhhli commented Feb 26, 2019 via email

@josianerodrigues
Copy link

thank you! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants