facebookresearch / DomainBed

DomainBed is a suite to test domain generalization algorithms
MIT License
1.42k stars 298 forks source link

Unable to get the code running #66

Closed ukdsvl closed 3 years ago

ukdsvl commented 3 years ago

Getting the following error when even the simple python3 -m domainbed.scripts.train is run:

FileNotFoundError: Found no valid file for the classes raw. Supported extensions are: .jpg, .jpeg, .png, .ppm, .bmp, .pgm, .tif, .tiff, .webp

Trying out for PACS dataset, and found that all image types are indeed proper (i.e. png)

lopezpaz commented 3 years ago

We need more context, i.e., exact command, path of dataset...

ukdsvl commented 3 years ago

Thanks for your response. While trying out your repo for the first time, I ended up running multiple commands in arbitrary order. In doing so, I recall running python -m unittest discover as well. I cannot confidently point out what exactly caused the issue. Very likely some hidden files got created inside the dataset directory, which when tried to be picked up by the dataloader might have given this error.

As a remedy I resorted to deleting my entire dataset directories, downloaded them again, ran the commands for launching the sweep.py , and then things started working well.

I just have few more questions:

  1. Is it mandatory to use python3 for running python3 -m domainbed.scripts.download and python3 -m domainbed.scripts.train respectively ? When I tried python -m domainbed.scripts.download, it was not working

  2. Also, is it necessary that the datasets need to be downloaded into --data_dir=./domainbed/data , or it's fine in downloading to them to any path in my local system ?

  3. Perhaps it is there somewhere in the repo, but as I did not explicitly find this in the readme, it was bit confusing to me about the nature of the environment where the code needs to be run upon. I found the following to be helpful (hence, thinking of sharing here, so that if someone else finds a similar issue, it would be helpful to them):

conda create -p //dgbed python=3.8 conda activate dgbed pip install gdown pip install wilds pip install parameterized

P.S. As my main issue of getting the code running is resolved, you may close this issue as well (but please do answer my above 3 questions. Apologies if something is obvious/ trivial. )

lopezpaz commented 3 years ago
  1. It is mandatory to use python3. Note that your script python can be already pointing to python3. To know this, execute python without arguments and take a look at the banner.
  2. Any path is fine, as long as you specify it correctly using --data_dir.
  3. Any python3 environment with the necessary dependencies should work.