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

前端 未结 2 734
小蘑菇
小蘑菇 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:45

    it seems like you data has 2 dimensions, so data.shape[1:] is only one integer. Hence the error message

提交回复
热议问题