NVlabs / stylegan2-ada

StyleGAN2 with adaptive discriminator augmentation (ADA) - Official TensorFlow implementation
https://arxiv.org/abs/2006.06676
Other
1.8k stars 501 forks source link

FFHQ download script broken #115

Open kyleliang919 opened 2 years ago

kyleliang919 commented 2 years ago
File "download_ffhq.py", line 84, in download_file
    raise IOError('Incorrect file size', file_path)
OSError: [Errno Incorrect file size] ffhq-dataset-v2.json
Sid-XXD commented 1 year ago

I have the same error. Have you fix this error? please tell me. Thank you very much.

nikolaireinke commented 1 year ago

This error occurs because instead of sending the file right away, the Google server responds with a message that it can't scan the file for viruses and then waits for a response.

I had to change the url for the json-File from: json_spec = dict(file_url='https://drive.google.com/uc?id=16N0RV4fHI6joBuKbQAoG34V_cQk7vxSA', file_path='ffhq-dataset-v2.json', file_size=267793842, file_md5='425ae20f06a4da1d4dc0f46d40ba5fd6')

to: json_spec = dict(file_url='https://drive.google.com/uc?export=download&id=16N0RV4fHI6joBuKbQAoG34V_cQk7vxSA', file_path='ffhq-dataset-v2.json', file_size=267793842, file_md5='425ae20f06a4da1d4dc0f46d40ba5fd6')

So basically just added export=download&.

Then the file downloaded properly for me.

shu7bh commented 8 months ago

Using @nikolaireinke's fix is still giving me the same error.

python download_ffhq.py --json --images
Downloading JSON metadata...
-   0.00% done  1/2 files  0.00/0.25 GB   0.00 B/s    ETA: ...     Traceback (most recent call last):
  File "download_ffhq.py", line 445, in <module>
    run_cmdline(sys.argv)
  File "download_ffhq.py", line 440, in run_cmdline
    run(**vars(args))
  File "download_ffhq.py", line 387, in run
    download_files([json_spec, license_specs['json']], **download_kwargs)
  File "download_ffhq.py", line 205, in download_files
    raise exc_info[1].with_traceback(exc_info[2])
  File "download_ffhq.py", line 214, in _download_thread
    download_file(session, spec, stats, **download_kwargs)
  File "download_ffhq.py", line 84, in download_file
    raise IOError('Incorrect file size', file_path)
OSError: [Errno Incorrect file size] ffhq-dataset-v2.json
jasuriy commented 4 months ago

@Sid-XXD hi were you able to train the model with ffhq dataset or any other dataset? please can you help me thank you

Sid-XXD commented 4 months ago

@Sid-XXD hi were you able to train the model with ffhq dataset or any other dataset? please can you help me thank you

Hi jasurity, I'm sorry that I haven't worked in face images for a long time. I remember the CelebaA-HQ dataset that I may have used before, which may be helpful to you.

MarcusOuelletus commented 5 days ago

In the repo you'll find a file called download_ffhq.py which has a json_spec line at the top with a file url, if you go to that url in your browser and download the json, then put the downloaded json file in the same folder from which you're calling download_ffhq.py, it will work as expected.

The issue is that google drive now shows a prompt that the file is to big to scan for viruses, if you look at the json file the script downloads, it's just the html for that virus-scanning prompt.