Closed zhyyfaan closed 3 years ago
I have this problem, and I guess it may relate to the version of pytorch or other environments, I don't know how to deal with.
Hi @zhyyfaan , I got the same issue. Would you like to share how did you solve this problem?
I forgot to download the inception model , you can check if you hava the same problem.
------------------ 原始邮件 ------------------ 发件人: "Brando @.>; 发送时间: 2021年9月14日(星期二) 晚上6:15 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [GaParmar/clean-fid] PytorchStreamReader failed reading zip archive: failed finding central directory (#9)
I have this problem, and I guess it may relate to the version of pytorch or other environments, I don't know how to deal with.
Hi @zhyyfaan , I got the same issue. Would you like to share how did you solve this problem?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
This is great that you were able to resolve this issue. Feel free to reopen this issue and let me know if the problem persists.
OK!
------------------ 原始邮件 ------------------ 发件人: "Gaurav @.>; 发送时间: 2021年9月14日(星期二) 晚上7:01 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [GaParmar/clean-fid] PytorchStreamReader failed reading zip archive: failed finding central directory (#9)
This is great that you were able to resolve this issue. Feel free to reopen this issue and let me know if the problem persists.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
@zhyyfaan Which PyTorch version did you use?
From code below, the Inception model will be downloaded automatically.
Some of my environment:
torch==1.7.0
clean-fid==0.1.13
requests==2.25.1
Pillow==8.3.2
tqdm==4.51.0
torchvision==0.8.1
scipy==1.7.1
Can you try manually deleting the inception weights currently downloaded in the "/tmp" directory and running the script again?
Can you try manually deleting the inception weights currently downloaded in the "/tmp" directory and running the script again?
Awesome, it works!
BTW, when I make_custom_stats
, I got the following error:
saving custom stats to /home/brando/.local/lib/python3.7/site-packages/cleanfid/stats/sunglasses_clean_custom_na.npz
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/brando/.local/lib/python3.7/site-packages/cleanfid/fid.py", line 303, in make_custom_stats
np.savez_compressed(outf, mu=mu, sigma=sigma)
File "<__array_function__ internals>", line 6, in savez_compressed
File "/usr/local/lib/python3.7/dist-packages/numpy/lib/npyio.py", line 686, in savez_compressed
_savez(file, args, kwds, True)
File "/usr/local/lib/python3.7/dist-packages/numpy/lib/npyio.py", line 712, in _savez
zipf = zipfile_factory(file, mode="w", compression=compression)
File "/usr/local/lib/python3.7/dist-packages/numpy/lib/npyio.py", line 112, in zipfile_factory
return zipfile.ZipFile(file, *args, **kwargs)
File "/usr/lib/python3.7/zipfile.py", line 1204, in __init__
self.fp = io.open(file, filemode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/brando/.local/lib/python3.7/site-packages/cleanfid/stats/sunglasses_clean_custom_na.npz'
It was resolved when I manually created directory stats
in /home/brando/.local/lib/python3.7/site-packages/cleanfid/
.
Maybe you could os.makedirs(xxx, exist_ok=True)
after https://github.com/GaParmar/clean-fid/blob/8f06f1b2fc4908184fbc0d10714d7b93ea4d18fd/cleanfid/fid.py#L284 .
Hi @GaParmar, one more issue, can I create custom dataset statistics to compute KID?
In my trial, after make_custom_stats
, the invoking of compute_fid
works fine but compute_kid
tries to download the statistics:
>>> fid.compute_kid('sunglasses/0', dataset_name='sunglasses', mode='clean', dataset_res=256, dataset_split='custom')
compute KID of a folder with sunglasses statistics
downloading statistics to /home/brando/.local/lib/python3.7/site-packages/cleanfid/stats/sunglasses_clean_custom_na_kid.npz
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/brando/.local/lib/python3.7/site-packages/cleanfid/fid.py", line 335, in compute_kid
mode=mode, seed=0, split=dataset_split, metric="KID")
File "/home/brando/.local/lib/python3.7/site-packages/cleanfid/features.py", line 95, in get_reference_statistics
fpath = check_download_url(local_folder=stats_folder, url=url)
File "/home/brando/.local/lib/python3.7/site-packages/cleanfid/downloads_helper.py", line 27, in check_download_url
with urllib.request.urlopen(url) as response, open(local_path, 'wb') as f:
File "/usr/lib/python3.7/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.7/urllib/request.py", line 531, in open
response = meth(req, response)
File "/usr/lib/python3.7/urllib/request.py", line 641, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python3.7/urllib/request.py", line 569, in error
return self._call_chain(*args)
File "/usr/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/usr/lib/python3.7/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found
Thanks for pointing this out! Yeah I will add this in the next release. (meanwhile, a temporary fix can be to manually place the custom stats in the folder) Could you make a new open github issue for these?
Thanks for pointing this out! Yeah I will add this in the next release. (meanwhile, a temporary fix can be to manually place the custom stats in the folder) Could you make a new open github issue for these?
Sure, thanks for your patience!
OK! … ------------------ 原始邮件 ------------------ 发件人: "Gaurav @.>; 发送时间: 2021年9月14日(星期二) 晚上7:01 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [GaParmar/clean-fid] PytorchStreamReader failed reading zip archive: failed finding central directory (#9) This is great that you were able to resolve this issue. Feel free to reopen this issue and let me know if the problem persists. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
l have the same issue what will i do please
i keep on bring this up and it wont pop the camera
I have this problem, and I guess it may relate to the version of pytorch or other environments, I don't know how to deal with.