TensorFlow版本带来的concat错误

版权声明:本文为博主原创文章,允许转载,注明出处,回复告诉博主一声即可。 https://blog.csdn.net/Cloudox_/article/details/78548899

错误提示:

TypeError: Expected int32, got list containing Tensors of type ‘_Message’ instead.

错误说明:

根据提示知道代码中一行concat相关的代码。
是由于TensorFlow版本带来的错误。

在TensorFlow 1.0以前的版本(0.x)的API中,concat的参数是数字在前,tensors在后的:

tf.concat(3, net, name=name)

而在TensorFlow 1.0版本以后的API中,concat的参数是tensors在前,数字在后的:

tf.concat(net, 3, name=name)

因为参考的代码可能当时运行的TensorFlow版本与本机版本不同,所以有了问题。

解决方案:

根据错误提示找到对应代码行,把concat的参数调换一下顺序就可以成功运行了。


版权所有:http://blog.csdn.net/cloudox_
参考:http://blog.csdn.net/zcf1784266476/article/details/71248799

猜你喜欢

转载自blog.csdn.net/Cloudox_/article/details/78548899
今日推荐