Python AxisError:轴1超出维度为1的数组的界限
这是我的代码:Python AxisError:轴1超出维度为1的数组的界限,python,arrays,artificial-intelligence,Python,Arrays,Artificial Intelligence,这是我的代码: config = Config(mode='conv') if config.mode == 'conv': X, y = build_rand_feat() y_flat = np.argmax(y, axis=1) model=get_conv_model() elif config.mode == 'time': X, y = build_rand_feat() y_flat
config = Config(mode='conv')
if config.mode == 'conv':
X, y = build_rand_feat()
y_flat = np.argmax(y, axis=1)
model=get_conv_model()
elif config.mode == 'time':
X, y = build_rand_feat()
y_flat = np.argmax(y,axis=1)
input_shape = (X.shape[1], X.shape[2])
model = get_recurrent_model()
请帮我解决这个问题。只需更改为轴0,因为它只有一个维度。祝你好运 错误很明显,不能对一维数据执行
axis=1
。您可以执行axis=0,但我们不知道数据是什么,也不知道您希望发生什么,因此我无法确定您是否需要这些数据