tensorflow报错Can not squeeze dim[1], expected a dimension of 1, got n for解决办法

Posted Lenskit

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了tensorflow报错Can not squeeze dim[1], expected a dimension of 1, got n for解决办法相关的知识,希望对你有一定的参考价值。

这是因为tf的文档要求label必须是一个单独的值,而不是一个one-hot编码后像[1,0,0], [0,1,0], [0,0,1].的值。

 

以上是关于tensorflow报错Can not squeeze dim[1], expected a dimension of 1, got n for解决办法的主要内容,如果未能解决你的问题,请参考以下文章