Missing error "TypeError: Tensors...that don't all match" in python 3

Asked 2 years ago, Updated 2 years ago, 40 views

Traceback (most recent call last):
  File"/Users/oshikawaakinobu/anaconda3/lib/python 3.6/site-packages/tensorflow/python/framework/op_def_library.py", line458, in_apply_op_helper
    raiseTypeError()#All types should match.
TypeError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "run_mnist.py", line 235, in<module>
    main(parser.parse_args())
  File "run_mnist.py", line 137, in main
    pred=deep_mnist(args,x,train_phase)
  File"/Users/oshikawaakinobu/mnist_model.py", line 35, deep_mnist
    cv1 = hn_lite.conv2d(x,nf,fs,padding='SAME',n_rings=nr,name='1')
  File"/Users/oshikawaakinobu/harmonic_network_lite.py", line 38, in conv2d
    name = name )
  File"/Users/oshikawaakinobu/harmonic_network_ops.py", line 56, in h_conv
    new_shape=tf.concat(axis=0, values=[Ysh[:3], [max_order+1,2], [Ysh[3]/(2*(max_order+1)))]])
  File"/Users/oshikawaakinobu/anaconda3/lib/python 3.6/site-packages/tensorflow/python/ops/array_ops.py", line 1113, in concat
    return gen_array_ops.concat_v2(values=values,axis=axis,name=name)
  File"/Users/oshikawaakinobu/anaconda3/lib/python 3.6/site-packages/tensorflow/python/ops/gen_array_ops.py", line 1029, inconcat_v2
    "ConcatV2", values=values, axis=axis, name=name)
  File"/Users/oshikawaakinobu/anaconda3/lib/python 3.6/site-packages/tensorflow/python/framework/op_def_library.py", line483, in_apply_op_helper
    raise TypeError("%s that don't all match."%prefix)
TypeError: Tensors in list passed to 'values' of 'ConcatV2' Op have types [int32, int32, float32] that don't all match.

python python3 tensorflow

2022-09-30 19:03

1 Answers

TypeError: Tensors in list passed to 'values' of 'ConcatV2' Op have types [int32, int32, float32] that don't all match. (The tensor values should all be the same type) The types don't match!
 This is the content of the error.

While making the list, it has been pointed out that the reason for the error is that the value of int32 and float32 are mixed, so I think it will be easier to find the problem if you review the code from that point of view.


2022-09-30 19:03

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.