TypeError: List of Tensors when single Tensor expected
chenxiao521 opened this issue · comments
hi, @xuannianz I try to train the VOC data, and get this error
File "/home/bigdata/chenfangxiong/keras-GaussianYOLOv3/train.py", line 341, in
main()
File "/home/bigdata/chenfangxiong/keras-GaussianYOLOv3/train.py", line 295, in main
model, prediction_model = yolo_body(anchors, num_classes=num_classes)
File "/home/bigdata/chenfangxiong/keras-GaussianYOLOv3/model.py", line 130, in yolo_body
[y1, y2, y3, fm_13_input, fm_26_input, fm_52_input])
File "/home/bigdata/.conda/envs/fcon/lib/python3.6/site-packages/keras/engine/base_layer.py", line 451, in call
output = self.call(inputs, **kwargs)
File "/home/bigdata/.conda/envs/fcon/lib/python3.6/site-packages/keras/layers/core.py", line 716, in call
return self.function(inputs, **arguments)
File "/home/bigdata/chenfangxiong/keras-GaussianYOLOv3/loss.py", line 46, in yolo_loss
raw_y_pred = K.reshape(yolo_output, [-1, grid_shape[0], grid_shape[1], num_anchors_per_layer, num_classes + 9])
File "/home/bigdata/.conda/envs/fcon/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2189, in reshape
return tf.reshape(x, shape)
File "/home/bigdata/.conda/envs/fcon/lib/python3.6/site-packages/tensorflow/python/ops/gen_array_ops.py", line 6197, in reshape
"Reshape", tensor=tensor, shape=shape, name=name)
File "/home/bigdata/.conda/envs/fcon/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 513, in _apply_op_helper
raise err
File "/home/bigdata/.conda/envs/fcon/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 510, in _apply_op_helper
preferred_dtype=default_dtype)
File "/home/bigdata/.conda/envs/fcon/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1107, in internal_convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "/home/bigdata/.conda/envs/fcon/lib/python3.6/site-packages/tensorflow/python/framework/constant_op.py", line 217, in _constant_tensor_conversion_function
return constant(v, dtype=dtype, name=name)
File "/home/bigdata/.conda/envs/fcon/lib/python3.6/site-packages/tensorflow/python/framework/constant_op.py", line 196, in constant
value, dtype=dtype, shape=shape, verify_shape=verify_shape))
File "/home/bigdata/.conda/envs/fcon/lib/python3.6/site-packages/tensorflow/python/framework/tensor_util.py", line 436, in make_tensor_proto
_AssertCompatible(values, dtype)
File "/home/bigdata/.conda/envs/fcon/lib/python3.6/site-packages/tensorflow/python/framework/tensor_util.py", line 344, in _AssertCompatible
raise TypeError("List of Tensors when single Tensor expected")
TypeError: List of Tensors when single Tensor expected
Hi, did you change any code? The error message hints yolo_output
is a list, but It should be a tensor.
Lines 45 to 46 in 4efd92c
Hi, did you change any code? The error message hints
yolo_output
is a list, but It should be a tensor.
Lines 45 to 46 in 4efd92c
not., Can you tell me your environment configuration.
Take a look at requirements.txt.
Take a look at requirements.txt.
thanks
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.