GaParmar / clean-fid

PyTorch - FID calculation with proper image resizing and quantization steps [CVPR 2022]
https://www.cs.cmu.edu/~clean-fid/
MIT License
894 stars 68 forks source link

Imaginary component with more than 2048 images #53

Open bertinma opened 8 months ago

bertinma commented 8 months ago

Hi,

I am facing the Imaginary component issue unless I have more than 2048 images in each folder.

I use this line of code to compute it. fid_score = fid.compute_fid(source, target, mode="clean", verbose=True, dataset_split="custom", use_dataparallel=False)

The weird thing is that happens only on validation set, on a subset of training set it works well. Unless I perform exact same operations on both, as saving model predictions and targets using torchvision.

I am using clean-fid==0.1.35 CUDA 11.8 Python 3.10.13 numpy==1.26 torch==2.0.1 Debian 11

Thanks for tyour help in advance ;)

vinesmsuic commented 7 months ago

Hi, encountered same error here. Did you figure out how to solve this?

vinesmsuic commented 7 months ago

scipy has to be 1.11.1 instead of 1.11.2 . Just downgrade it with:

pip install scipy==1.11.1
GaParmar commented 7 months ago

Thanks for finding the cause of this issue!

SantiagoDGarcia commented 6 months ago

Thanks @vinesmsuic

Luciennnnnnn commented 4 months ago

It may because this PR.