Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sharma96/ef151c9f14a464d5b006da31ae369394 to your computer and use it in GitHub Desktop.
Save Sharma96/ef151c9f14a464d5b006da31ae369394 to your computer and use it in GitHub Desktop.
er.py
TypeError Traceback (most recent call last)
<ipython-input-10-394d9d79c99b> in <module>()
67 # training pipeline
68 lr = 0.001
---> 69 logits = my_net(x, n_classes=n_classes)
70 cross_entropy = tf.nn.sparse_softmax_cross_entropy_with_logits(logits=logits, labels=y)
71 loss_function = tf.reduce_mean(cross_entropy)
<ipython-input-10-394d9d79c99b> in my_net(x, n_classes)
42 drop2 = tf.nn.dropout(pool2, keep_prob=keep_prob)
43
---> 44 fc0 = tf.concat(1, [flatten(drop1), flatten(drop2)])
45
46 fc1_out = 64
/usr/local/lib/python3.4/dist-packages/tensorflow/python/ops/array_ops.py in concat(values, axis, name)
1170 ops.convert_to_tensor(
1171 axis, name="concat_dim",
-> 1172 dtype=dtypes.int32).get_shape().assert_is_compatible_with(
1173 tensor_shape.scalar())
1174 return identity(values[0], name=scope)
/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/ops.py in convert_to_tensor(value, dtype, name, preferred_dtype)
944 name=name,
945 preferred_dtype=preferred_dtype,
--> 946 as_ref=False)
947
948
/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/ops.py in internal_convert_to_tensor(value, dtype, name, as_ref, preferred_dtype, ctx)
1034
1035 if ret is None:
-> 1036 ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
1037
1038 if ret is NotImplemented:
/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/constant_op.py in _constant_tensor_conversion_function(v, dtype, name, as_ref)
233 as_ref=False):
234 _ = as_ref
--> 235 return constant(v, dtype=dtype, name=name)
236
237
/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/constant_op.py in constant(value, dtype, shape, name, verify_shape)
212 tensor_value.tensor.CopyFrom(
213 tensor_util.make_tensor_proto(
--> 214 value, dtype=dtype, shape=shape, verify_shape=verify_shape))
215 dtype_value = attr_value_pb2.AttrValue(type=tensor_value.tensor.dtype)
216 const_tensor = g.create_op(
/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/tensor_util.py in make_tensor_proto(values, dtype, shape, verify_shape)
431 nparray = np.empty(shape, dtype=np_dt)
432 else:
--> 433 _AssertCompatible(values, dtype)
434 nparray = np.array(values, dtype=np_dt)
435 # check to them.
/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/tensor_util.py in _AssertCompatible(values, dtype)
342 else:
343 raise TypeError("Expected %s, got %s of type '%s' instead." %
--> 344 (dtype.name, repr(mismatch), type(mismatch).__name__))
345
346
TypeError: Expected int32, got list containing Tensors of type '_Message' instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment