mseitzer / pytorch-fid

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

How to calculate fid score with label #101

Closed leibohan closed 5 months ago

leibohan commented 9 months ago

when I try to test a model with label condition inside with fid_score, it throws: ` File "fid_test.py", line 40, in

a, b = pytorch_fid.fid_score.calculate_activation_statistics(fid_files, G, 4, 1024, 'cuda')

File "/home/lbh/anaconda3/envs/torch_py3.7/lib/python3.7/site-packages/pytorch_fid/fid_score.py", line 228, in calculate_activation_statistics

act = get_activations(files, model, batch_size, dims, device, num_workers)

File "/home/lbh/anaconda3/envs/torch_py3.7/lib/python3.7/site-packages/pytorch_fid/fid_score.py", line 136, in get_activations

pred = model(batch)[0]

File "/home/lbh/anaconda3/envs/torch_py3.7/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl

return forward_call(*input, **kwargs)

TypeError: forward() missing 1 required positional argument: 'y'`

I am wondering where I can input my label inside.

mseitzer commented 5 months ago

FID score does not use or need labels to compute, so I don't quite understand the question.