tensorflow提示出错'module' object has no attribute 'pack'

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_31278903/article/details/84983781

编译旧的代码,会像下面这样提示出错:

deconv_shape3 = tf.pack([shape[0], shape[1], shape[2], NUM_OF_CLASSESS])

AttributeError: 'module' object has no attribute 'pack'

因为TF后面的版本修改了这个函数的名称,把tf.pack改为 tf.stack。

因此只需要替换掉,就可以编译通过了。

猜你喜欢

转载自blog.csdn.net/qq_31278903/article/details/84983781