buriburisuri / sugartensor

A slim tensorflow wrapper that provides syntactic sugar for tensor variables. This library will be helpful for practical deep learning researchers not beginners.
MIT License
372 stars 63 forks source link

TypeError occurs when executing generate.py of ac-gan with tensorflow 1.0.0-rc0 #13

Closed hyunghunny closed 3 years ago

hyunghunny commented 7 years ago

Dear,

When I run generate.py of ac-gan project ([https://github.com/buriburisuri/ac-gan]()), TypeError occurs from sugartensor stack as follows:

webofthink@titan4x:~/ac-gan$ python generate.py
/home/adsl/anaconda2/lib/python2.7/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')
Traceback (most recent call last):
  File "generate.py", line 55, in <module>
    z = z.sg_concat(target=[target_cval_1.sg_expand_dims(), target_cval_2.sg_expand_dims()])
  File "/home/adsl/anaconda2/lib/python2.7/site-packages/sugartensor/sg_main.py", line 84, in wrapper
    out = func(tensor, tf.sg_opt(kwargs))
  File "/home/adsl/anaconda2/lib/python2.7/site-packages/sugartensor/sg_transform.py", line 75, in sg_concat
    return tf.concat(opt.dim, [tensor] + target, name=opt.name)
  File "/home/adsl/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.py", line 1047, in concat
    dtype=dtypes.int32).get_shape(
  File "/home/adsl/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 651, in convert_to_tensor
    as_ref=False)
  File "/home/adsl/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 716, in internal_convert_to_tensor
    ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
  File "/home/adsl/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/constant_op.py", line 176, in _constant_tensor_conversion_function
    return constant(v, dtype=dtype, name=name)
  File "/home/adsl/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/constant_op.py", line 165, in constant
    tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape, verify_shape=verify_shape))
  File "/home/adsl/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/tensor_util.py", line 367, in make_tensor_proto
    _AssertCompatible(values, dtype)
  File "/home/adsl/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/tensor_util.py", line 302, in _AssertCompatible
    (dtype.name, repr(mismatch), type(mismatch).__name__))
TypeError: Expected int32, got list containing Tensors of type '_Message' instead.

As a prerequite you mentioned, tensorflow 1.0.0-rc0 (tensorflow >= 0.12.0) may be supported properly. Below shows my tensorflow version:

>>> import tensorflow as tf
>>> print tf.__version__
1.0.0-rc0
>>>

Thank you for sharing nice work. Hope that this makes it better.

buriburisuri commented 7 years ago

@hyunghunny Thanks for your information. I've never tried tensorflow 1.0 version. I'll check this issue. Thank you again.

ProgramItUp commented 7 years ago

@buriburisuri I'm curious, have you had a chance to upgrade sugartensor now that Tensorflow 1.0 is out?