w86763777/pytorch-image-generation-metrics

Exception when computing FID

caradryanl opened this issue · 2 comments

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?

How many images in ./textual_inversion/cat_statue?