mseitzer / pytorch-fid

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

pytorch_fid version failing on windows #72

Closed gucifer closed 2 years ago

gucifer commented 3 years ago

Thanks a lot for the effort on the FID implementation. A small bug I noticed is that https://github.com/mseitzer/pytorch-fid/blob/d042ab8a9f8e4b388c21bc7b38d9599c5fbcfe7b/setup.py#L25 will lead to an error in windows as windows uses \ instead of / in pathing. I would like to very use this metric for testing my own implementation of FID in pytorch ignite. But circle-ci based tests seem to be failing because of it.

A possible solution would be to use os module for generating path, Code looks similar to this.

import os.path
data_folder = os.path.join("source_data", "text_files")
file_to_open = os.path.join(data_folder, "raw_data.txt")
f = open(file_to_open)
print(f.read())