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

FFHQ download script broken #115

Open
kyleliang919 opened this issue Sep 14, 2022 · 6 comments
Open

FFHQ download script broken #115

kyleliang919 opened this issue Sep 14, 2022 · 6 comments

Comments

@kyleliang919
Copy link

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
Copy link

Sid-XXD commented Dec 10, 2022

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

@nikolaireinke
Copy link

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
Copy link

shu7bh commented Jan 25, 2024

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
Copy link

jasuriy commented May 13, 2024

@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
Copy link

Sid-XXD commented May 14, 2024

@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
Copy link

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.

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

6 participants