mseitzer / pytorch-fid

Compute FID scores with PyTorch.
Apache License 2.0
3.22k stars 497 forks source link

FID is a negative value #105

Open santiago-parodi opened 5 months ago

santiago-parodi commented 5 months ago

I'm attempting to compute the FID between two datasets, each containing 192 samples. I used the following command:

python -m pytorch_fid --dims 192 ./real/ ./fake/

However, I'm getting a negative FID value:

FID: -4.808164533187664e-09

Any ideas of what might be happening? Thanks in advance!

dome272 commented 3 months ago

I saw this sometimes as well. I think its numerical instabilities. When your ground_truth and fake_data are super close it would end up as 0 in theory, but due to limited numerical precision it goes slightly negative. You can see its -4e-8, which is super small.

egoist945402376 commented 2 months ago

I saw this sometimes as well. I think its numerical instabilities. When your ground_truth and fake_data are super close it would end up as 0 in theory, but due to limited numerical precision it goes slightly negative. You can see its -4e-8, which is super small.

Thanks