mseitzer / pytorch-fid

Compute FID scores with PyTorch.
Apache License 2.0
3.34k stars 506 forks source link

Why do I always encounter error: 'ValueError: Imaginary component 89928690.58258057' #29

Closed BlackAngel-511 closed 4 years ago

BlackAngel-511 commented 4 years ago

I use the fid.py to measure fid score of my images datasets, I generated 10000 images in tImages directory and used the command 'python fid.py ./tImages fid_stats_celeba.npz' or 'python fid.py ./tImages ./sImages ' (sImages directory is another images datasets), but waiting a while, I always get a ValueError. e.g. 'ValueError: Imaginary component 89928690.58258057' or 'ValueError: Imaginary component 1.376687186290827e+24'. I don't know which step I did wrong. Could anyone tell me what the problem is, thanks!

error information: Traceback (most recent call last): File "fid.py", line 334, in fid_value = calculate_fid_given_paths(args.path, args.inception, low_profile=args.lowprofile) File "fid.py", line 317, in calculate_fid_given_paths fid_value = calculate_frechet_distance(m1, s1, m2, s2) File "fid.py", line 155, in calculate_frechet_distance raise ValueError("Imaginary component {}".format(m)) ValueError: Imaginary component 1.376687186290827e+24

AmberCheng commented 3 years ago

I use the fid.py to measure fid score of my images datasets, I generated 10000 images in tImages directory and used the command 'python fid.py ./tImages fid_stats_celeba.npz' or 'python fid.py ./tImages ./sImages ' (sImages directory is another images datasets), but waiting a while, I always get a ValueError. e.g. 'ValueError: Imaginary component 89928690.58258057' or 'ValueError: Imaginary component 1.376687186290827e+24'. I don't know which step I did wrong. Could anyone tell me what the problem is, thanks!

error information: Traceback (most recent call last): File "fid.py", line 334, in fid_value = calculate_fid_given_paths(args.path, args.inception, low_profile=args.lowprofile) File "fid.py", line 317, in calculate_fid_given_paths fid_value = calculate_frechet_distance(m1, s1, m2, s2) File "fid.py", line 155, in calculate_frechet_distance raise ValueError("Imaginary component {}".format(m)) ValueError: Imaginary component 1.376687186290827e+24

@BlackAngel-511 Hi, I have met this problem recently. May I know how you solve it?

MightyElemental commented 1 year ago

@AmberCheng Sorry to revive a dead issue, but I thought it was important to document this. I ran into the same issue but found it originated from the scipy library. I used version 1.7.3, but the issue was resolved after upgrading to version 1.10.1.