---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
~/anaconda3/envs/arasdar-DL-env/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py in zeros(shape, dtype, name)
1437 try:
-> 1438 shape = tensor_shape.as_shape(shape)
1439 output = constant(zero, shape=shape, dtype=dtype, name=name)
~/anaconda3/envs/arasdar-DL-env/lib/python3.6/site-packages/tensorflow/python/framework/tensor_shape.py in as_shape(shape)
848 else:
--> 849 return TensorShape(shape)
850
~/anaconda3/envs/arasdar-DL-env/lib/python3.6/site-packages/tensorflow/python/framework/tensor_shape.py in __init__(self, dims)
454 # Got a list of dimensions
--> 455 self._dims = [as_dimension(d) for d in dims_iter]
456
~/anaconda3/envs/arasdar-DL-env/lib/python3.6/site-packages/tensorflow/python/framework/tensor_shape.py in <listcomp>(.0)
454 # Got a list of dimensions
--> 455 self._dims = [as_dimension(d) for d in dims_iter]
456
~/anaconda3/envs/arasdar-DL-env/lib/python3.6/site-packages/tensorflow/python/framework/tensor_shape.py in as_dimension(value)
396 else:
--> 397 return Dimension(value)
398
~/anaconda3/envs/arasdar-DL-env/lib/python3.6/site-packages/tensorflow/python/framework/tensor_shape.py in __init__(self, value)
31 else:
---> 32 self._value = int(value)
33 if (not isinstance(value, compat.bytes_or_text_types) and
TypeError: int() argument must be a string, a bytes-like object or a number, not 'LSTMStateTuple'
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)
<ipython-input-2-05640723c92a> in <module>()
35 bhy = tf.Variable(tf.zeros(vocab_size))
36
---> 37 initial_state = state = tf.zeros(shape=[batch_size, lstm.state_size])
38 loss = 0.
39
~/anaconda3/envs/arasdar-DL-env/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py in zeros(shape, dtype, name)
1439 output = constant(zero, shape=shape, dtype=dtype, name=name)
1440 except (TypeError, ValueError):
-> 1441 shape = ops.convert_to_tensor(shape, dtype=dtypes.int32, name="shape")
1442 output = fill(shape, constant(zero, dtype=dtype), name=name)
1443 assert output.dtype.base_dtype == dtype
~/anaconda3/envs/arasdar-DL-env/lib/python3.6/site-packages/tensorflow/python/framework/ops.py in convert_to_tensor(value, dtype, name, preferred_dtype)
834 name=name,
835 preferred_dtype=preferred_dtype,
--> 836 as_ref=False)
837
838
~/anaconda3/envs/arasdar-DL-env/lib/python3.6/site-packages/tensorflow/python/framework/ops.py in internal_convert_to_tensor(value, dtype, name, as_ref, preferred_dtype, ctx)
924
925 if ret is None:
--> 926 ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
927
928 if ret is NotImplemented:
~/anaconda3/envs/arasdar-DL-env/lib/python3.6/site-packages/tensorflow/python/framework/constant_op.py in _constant_tensor_conversion_function(v, dtype, name, as_ref)
227 as_ref=False):
228 _ = as_ref
--> 229 return constant(v, dtype=dtype, name=name)
230
231
~/anaconda3/envs/arasdar-DL-env/lib/python3.6/site-packages/tensorflow/python/framework/constant_op.py in constant(value, dtype, shape, name, verify_shape)
206 tensor_value.tensor.CopyFrom(
207 tensor_util.make_tensor_proto(
--> 208 value, dtype=dtype, shape=shape, verify_shape=verify_shape))
209 dtype_value = attr_value_pb2.AttrValue(type=tensor_value.tensor.dtype)
210 const_tensor = g.create_op(
~/anaconda3/envs/arasdar-DL-env/lib/python3.6/site-packages/tensorflow/python/framework/tensor_util.py in make_tensor_proto(values, dtype, shape, verify_shape)
382 else:
383 _AssertCompatible(values, dtype)
--> 384 nparray = np.array(values, dtype=np_dt)
385 # check to them.
386 # We need to pass in quantized values as tuples, so don't apply the shape
ValueError: setting an array element with a sequence.