carpedm20 / DCGAN-tensorflow

A tensorflow implementation of "Deep Convolutional Generative Adversarial Networks"
http://carpedm20.github.io/faces/
MIT License
7.15k stars 2.62k forks source link

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

Open parahaoer opened 6 years ago

parahaoer commented 6 years ago

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

HyruleExplorer commented 6 years ago

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 commented 6 years ago

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.

liu1475341362 commented 6 years ago

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!!!

RobinWenqian commented 6 years ago

Thanks for HyruleExplorer's method. It works fine!

eastsky0614 commented 5 years ago

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!