w86763777 / pytorch-image-generation-metrics

Pytorch implementation of common image generation metrics.
Apache License 2.0
143 stars 16 forks source link

Exception when computing FID #6

Open caradryanl opened 1 year ago

caradryanl commented 1 year ago

When computing FID with following cmd:

      python -m pytorch_gan_metrics.calc_fid_stats \
             --path ./textual_inversion/cat_statue \
             --output ./textual_inversion/cat_statue/statistics.npz

I got this traceback.

/home/featurize/work/ldm/lib/python3.8/site-packages/numpy/core/fromnumeric.py:3474: RuntimeWarning: Mean of empty slice.
  return _methods._mean(a, axis=axis, dtype=dtype,
/home/featurize/work/ldm/lib/python3.8/site-packages/numpy/core/_methods.py:181: RuntimeWarning: invalid value encountered in true_divide
  ret = um.true_divide(
/home/featurize/work/ldm/lib/python3.8/site-packages/numpy/lib/function_base.py:495: RuntimeWarning: Mean of empty slice.
  avg = a.mean(axis)
/home/featurize/work/ldm/lib/python3.8/site-packages/pytorch_gan_metrics/utils.py:282: RuntimeWarning: Degrees of freedom <= 0 for slice
  sigma = np.cov(acts, rowvar=False)
/home/featurize/work/ldm/lib/python3.8/site-packages/numpy/lib/function_base.py:2680: RuntimeWarning: divide by zero encountered in true_divide
  c *= np.true_divide(1, fact)
/home/featurize/work/ldm/lib/python3.8/site-packages/numpy/lib/function_base.py:2680: RuntimeWarning: invalid value encountered in multiply
  c *= np.true_divide(1, fact)

Still I got a statistics.npz. However, I am not sure if it is correct. What's wrong with it?

w86763777 commented 1 year ago

How many images in ./textual_inversion/cat_statue?

caradryanl commented 1 year ago

6