tamarott / SinGAN

Official pytorch implementation of the paper: "SinGAN: Learning a Generative Model from a Single Natural Image"
https://tamarott.github.io/SinGAN.htm
Other
3.3k stars 612 forks source link

Warning in SIFID calculation code #93

Open hastinmodi opened 4 years ago

hastinmodi commented 4 years ago

Every time I execute the code of SIFID, it gives the value of SIFID as nan. The exact warning which it generates is as follows:

SIFID/sifid_score.py:262: RuntimeWarning: Mean of empty slice. print('SIFID: ', sifid_values.mean()) ../sinGAN/SinGAN-master/mypython/lib/python3.6/site-packages/numpy/core/_methods.py:161: RuntimeWarning: invalid value encountered in true_divide ret = ret.dtype.type(ret / rcount) SIFID: nan

I tried executing the code on both png and jpg type of images but it gives the same warning.

tamarott commented 4 years ago

Seems like you are trying to take the mean of a nan value. Make sure you input the correct image path.

hastinmodi commented 4 years ago

Thanks for the response, I checked the image path and it is correct, but the problem still persists.

zg2358 commented 4 years ago

I'm having the same problem. Did you solve it by any chance?

hastinmodi commented 4 years ago

No @zg2358 , I haven't solved it yet.

zg2358 commented 4 years ago

Okay, thank you for letting me know!

huanhuan414 commented 3 years ago

The command is like this. python SIFID/sifid_score.py --path2real Downloads/user_study/real/ --path2fake Downloads/user_study/fake_high_variance/

A-chen23 commented 3 years ago

I'm having the same problem. Did you solve it by any chance?

python SIFID/sifid_score.py --path2real "Input/Images/birds.jpg" --path2fake "fake_image/birds.jpg"

huanhuan414 commented 3 years ago

I'm having the same problem. Did you solve it by any chance?

python SIFID/sifid_score.py --path2real "Input/Images/birds.jpg" --path2fake "fake_image/birds.jpg"

please show me your command

A-chen23 commented 3 years ago

I'm having the same problem. Did you solve it by any chance? python SIFID/sifid_score.py --path2real "Input/Images/birds.jpg" --path2fake "fake_image/birds.jpg"

please show me your command

python SIFID/sifid_score.py --path2real "Input/Images/birds.jpg" --path2fake "fake_image/birds.jpg"

huanhuan414 commented 3 years ago

I'm having the same problem. Did you solve it by any chance? python SIFID/sifid_score.py --path2real "Input/Images/birds.jpg" --path2fake "fake_image/birds.jpg"

please show me your command

python SIFID/sifid_score.py --path2real "Input/Images/birds.jpg" --path2fake "fake_image/birds.jpg"

The right order is like this: python SIFID/sifid_score.py --path2real "Input/Images/" --path2fake "fake_image/"

A-chen23 commented 3 years ago

I'm having the same problem. Did you solve it by any chance? python SIFID/sifid_score.py --path2real "Input/Images/birds.jpg" --path2fake "fake_image/birds.jpg"

please show me your command

python SIFID/sifid_score.py --path2real "Input/Images/birds.jpg" --path2fake "fake_image/birds.jpg"

The right order is like this: python SIFID/sifid_score.py --path2real "Input/Images/" --path2fake "fake_image/"

Thanks for the response. I've solved this problem. But, I changed the code

“Im_ind.append(int(file_num1[:-4]))
Im_ind.append(int(file_num2[:-4]))" to "Im_ind.append(file_num1[:-4]) Im_ind.append(file_num2[:-4])". otherwise,get an error " ValueError: invalid literal for int() with base 10: 'birds' ",Why did this happen?