1. 程式人生 > >tensorflow提示出錯'module' object has no attribute 'pack'

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

編譯舊的程式碼,會像下面這樣提示出錯:

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。

因此只需要替換掉,就可以編譯通過了。