ValueError: Can not squeeze dim[1], expected a dimension of 1, got 3 for 'sparse_softmax_cross_entropy_loss

前端 未结 5 710
眼角桃花
眼角桃花 2020-12-09 15:18

I tried to replace the training and validation data with local images. But when running the training code, it came up with the error :

ValueError: Ca

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-09 15:48

    I have solved this error. The labels were in onehot encoding, so it was in dimension of [,10], rather than [,1]. So I used tf.argmax().

提交回复
热议问题