DCGAN-tensorflow icon indicating copy to clipboard operation
DCGAN-tensorflow copied to clipboard

absl.flags._exceptions.IllegalFlagValueError: flag --train_size=inf: Expect argument to be a string or int, found <type 'float'>

Open parahaoer opened this issue 7 years ago • 6 comments

parahaoer avatar Jan 09 '18 13:01 parahaoer

when I use datasets except mnist, it always has this error. I really don't know what is wrong with the codes.

parahaoer avatar Jan 10 '18 00:01 parahaoer

It also happens to me. I'm trying to use the celebA dataset which I downloaded with: python download.py mnist celebA But as soon as I try: python main.py --dataset celebA --input_height=108 --crop I get this error: absl.flags._exceptions.IllegalFlagValueError: flag --train_size=inf: Expect argument to be a string or int, found <type 'float'>

I'm using Python35.

Does anyone have any idea?

HyruleExplorer avatar Jan 28 '18 21:01 HyruleExplorer

Hey, I think I fixed this by changing this line in main.py from: flags.DEFINE_integer("train_size", np.inf, "The size of train images [np.inf]") to: flags.DEFINE_float("train_size", np.inf, "The size of train images [np.inf]")

It doesn't give me errors anymore and I'm able to train with the celebA dataset.

I'm using tensorflow-gpu 1.5.0 (last version), CUDA Toolkit 9.0, and cuDNN v7.

HyruleExplorer avatar Jan 29 '18 00:01 HyruleExplorer

flags.DEFINE_integer("train_size", np.inf, "The size of train images [np.inf]") to: flags.DEFINE_float("train_size", np.inf, "The size of train images [np.inf]")

it works!!!

liu1475341362 avatar Mar 19 '18 05:03 liu1475341362

Thanks for HyruleExplorer's method. It works fine!

RobinWenqian avatar Aug 05 '18 19:08 RobinWenqian

in train-dcgan.py

flags.DEFINE_integer("train_size", np.inf, "The size of train images [np.inf]") to: flags.DEFINE_float("train_size", np.inf, "The size of train images [np.inf]")

It works!

eastsky0614 avatar Aug 17 '19 10:08 eastsky0614