Python Tensorflow tf.concat在连接2个张量时引发奇怪错误

Python Tensorflow tf.concat在连接2个张量时引发奇怪错误,python,tensorflow,machine-learning,Python,Tensorflow,Machine Learning,这是我正在考虑的将2个张量(张量、数组张量)连接成“新张量”的代码,但是我返回了这个错误 如果它有助于我在Tensorflow 1.14.1-dev20190318上运行gpu tensor=None 数组_张量=无 虚拟\u张量=tf.将\u转换为\u张量(0.0,dtype=tf.float32) 虚拟张量(0.0,dtype=tf.float32) dataset=tf.data.dataset.from_张量(张量=(伪_张量,伪_张量_2)) 对于float_验证中的行: 打印(第[0

这是我正在考虑的将2个张量(张量、数组张量)连接成“新张量”的代码,但是我返回了这个错误

如果它有助于我在Tensorflow 1.14.1-dev20190318上运行gpu

tensor=None
数组_张量=无
虚拟\u张量=tf.将\u转换为\u张量(0.0,dtype=tf.float32)
虚拟张量(0.0,dtype=tf.float32)
dataset=tf.data.dataset.from_张量(张量=(伪_张量,伪_张量_2))
对于float_验证中的行:
打印(第[0]行)
tensor=tf.convert_to_tensor(行[0],数据类型=tf.float32)
数组_张量=tf.convert_to_张量(行[1],数据类型=tf.float32)
新的张量=tf.concat([张量,数组张量],轴=2)
#dataset=dataset.concatenate(tf.data.dataset.from_张量(张量=(张量,数组_张量)))
dataset=dataset.concatenate(tf.data.dataset.from_张量(张量=(新_张量)))
文件“D:\School\Last\u Year\thesis\u actual\thesis\thesis\thesis\u prototype\test.py”,第126行,在
新的张量=tf.concat([张量,数组张量],轴=2)
文件“D:\School\Last\u Year\thesis\u actual\thesis\thesis\thesis\u prototype\venv\lib\site packages\tensorflow\python\util\dispatch.py”,第180行,包装器
返回目标(*args,**kwargs)
concat中的文件“D:\School\Last\u Year\thesis\u actual\thesis\thesis\u prototype\venv\lib\site packages\tensorflow\python\ops\array\u ops.py”,第1271行
返回gen_数组操作concat_v2(值=值,轴=轴,名称=名称)
concat_v2中的文件“D:\School\Last_Year\thesis_actual\thesis\thesis_prototype\venv\lib\site packages\tensorflow\python\ops\gen_array\u ops.py”第1378行
_六、从(_核心。_状态_到_异常(例如代码、消息),无)
文件“”,第3行,从
tensorflow.python.framework.errors\u impl.InvalidArgumentError:ConcatOp:应在[0,0]范围内连接维度,但得到2个[Op:ConcatV2]名称:concat```
  File "D:\School\Last_Year\thesis_actual\thesis\thesis_prototype\test.py", line 126, in <module>
    new_tensor = tf.concat([tensor,array_tensor],axis=2)
  File "D:\School\Last_Year\thesis_actual\thesis\thesis_prototype\venv\lib\site-packages\tensorflow\python\util\dispatch.py", line 180, in wrapper
    return target(*args, **kwargs)
  File "D:\School\Last_Year\thesis_actual\thesis\thesis_prototype\venv\lib\site-packages\tensorflow\python\ops\array_ops.py", line 1271, in concat
    return gen_array_ops.concat_v2(values=values, axis=axis, name=name)
  File "D:\School\Last_Year\thesis_actual\thesis\thesis_prototype\venv\lib\site-packages\tensorflow\python\ops\gen_array_ops.py", line 1378, in concat_v2
    _six.raise_from(_core._status_to_exception(e.code, message), None)
  File "<string>", line 3, in raise_from
tensorflow.python.framework.errors_impl.InvalidArgumentError: ConcatOp : Expected concatenating dimensions in the range [0, 0), but got 2 [Op:ConcatV2] name: concat```