carpedm20 / carpedm20/DCGAN-tensorflow

Training using celebA dataset fails with error: Type mismatch: expected int32, got float

Open
#123 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.2k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

### Here is the output

{'batch_size': 64,
'beta1': 0.5,
'c_dim': 3,
'checkpoint_dir': 'checkpoint',
'dataset': 'celebA',
'epoch': 25,
'input_fname_pattern': '*.jpg',
'input_height': 108,
'input_width': None,
'is_crop': True,
'is_train': False,
'learning_rate': 0.0002,
'output_height': 64,
'output_width': None,
'sample_dir': 'samples',
'train_size': inf,
'visualize': False}
Traceback (most recent call last):
File "/home/aanam/dcgan/DCGAN-tensorflow/main.py", line 96, in
tf.app.run()
File "/public/apps/python/2.7.10/gcc.4.4.7/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 30, in run
sys.exit(main(sys.argv))
File "/home/aanam/dcgan/DCGAN-tensorflow/main.py", line 76, in main
sample_dir=FLAGS.sample_dir)
File "/home/aanam/dcgan/DCGAN-tensorflow/model.py", line 75, in __init__
self.build_model()
File "/home/aanam/dcgan/DCGAN-tensorflow/model.py", line 107, in build_model
self.G = self.generator(self.z)
File "/home/aanam/dcgan/DCGAN-tensorflow/model.py", line 359, in generator
self.z_, [-1, s_h16, s_w16, self.gf_dim * 8])
File "/public/apps/python/2.7.10/gcc.4.4.7/lib/python2.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 1758, in reshape
name=name)
File "/public/apps/python/2.7.10/gcc.4.4.7/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 454, in apply_op
as_ref=input_arg.is_ref)
File "/public/apps/python/2.7.10/gcc.4.4.7/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 628, in convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "/public/apps/python/2.7.10/gcc.4.4.7/lib/python2.7/site-packages/tensorflow/python/framework/constant_op.py", line 180, in _constant_tensor_conversion_function
return constant(v, dtype=dtype, name=name)
File "/public/apps/python/2.7.10/gcc.4.4.7/lib/python2.7/site-packages/tensorflow/python/framework/constant_op.py", line 163, in constant
tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape))
File "/public/apps/python/2.7.10/gcc.4.4.7/lib/python2.7/site-packages/tensorflow/python/framework/tensor_util.py", line 353, in make_tensor_proto
_AssertCompatible(values, dtype)
File "/public/apps/python/2.7.10/gcc.4.4.7/lib/python2.7/site-packages/tensorflow/python/framework/tensor_util.py", line 290, in _AssertCompatible
(dtype.name, repr(mismatch), type(mismatch).__name__))
TypeError: Expected int32, got 4.0 of type 'float' instead.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in model.py at the generator reshape call identified in the traceback, then reproduce the celebA training configuration shown in the issue. Trace the shape values passed to that call and verify that training starts without the reported TensorFlow type error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.