ValueError: not enough values to unpack (expected 2, got 1)?

前端 未结 2 735
小蘑菇
小蘑菇 2021-01-27 21:18
def cnn_data(data):
    x, y = data.shape[1:]
    return data.reshape((-1, x, y, 1))

We introduce this function used in the following code.



        
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-27 21:52

    In this line of code x and y are two values while data.shape is producing only one value:

    x, y = data.shape[1:]
    

提交回复
热议问题