Excuse me , is there any mistake in your code ? "data = data.reshape(-1, a_raw_shape[1][-1], 1)" I think maybe it is "data = data.reshape(-1, a_raw_shape[1][**0**], 1)"