天天看點

深度學習架構 TensorFlow 常見問題總結3. Keras VGG16中ValueError: filter must not be larger than the input問題的解決 

1. Check failed: s.ok() could not find cudnnCreate in cudnn DSO; 

  tensorflow/stream_executor/cuda/cuda_dnn.cc:221] Check failed: s.ok() could not find cudnnCreate in cudnn DSO; dlerror: /home/wangxiao/anaconda2/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so: undefined symbol: cudnnCreate

  Aborted

  

  參考了博文:http://blog.csdn.net/jk123vip/article/details/50361951 

  下載下傳了 cudnn-6.5-linux-x64-v2.tgz 并且按照上面說的安裝完畢後,發現,原本的錯誤是沒了,但是有了新的錯誤提示: 

  E tensorflow/stream_executor/cuda/cuda_dnn.cc:378] Loaded runtime CuDNN library: 2000 (compatibility version 2000) but source was compiled with 5105 (compatibility version 5100). If using a binary install, upgrade your CuDNN library to match. If building from sources, make sure the library loaded at runtime matches a compatible version specified during compile configuration.

  F tensorflow/core/kernels/conv_ops.cc:532] Check failed: stream->parent()->GetConvolveAlgorithms(&algorithms)

  又參考博文: http://blog.csdn.net/gongchangsan/article/details/52573254 

  上面提示說是 CUDNN 的版本太低導緻的。我呵呵。。。

深度學習架構 TensorFlow 常見問題總結3. Keras VGG16中ValueError: filter must not be larger than the input問題的解決 

  好吧,去安裝 cudnn7.5 

  鑒于我自己的 cuda 版本是 8.0,我下載下傳了 cudnn-8.0-linux-x64-v5.1.tgz 安裝後,還是這個鬼問題。。。。查了幾個博文,都說是 cudnn 版本太低的原因。

  http://blog.csdn.net/gavin__zhou/article/details/52693837

深度學習架構 TensorFlow 常見問題總結3. Keras VGG16中ValueError: filter must not be larger than the input問題的解決 

  心塞啊,難道是沒裝上 ?  

  2. 如何在 Linux 系統中,隻複制檔案夾,而不拷貝檔案夾内部的檔案? 隻是檔案夾的複制。。。

  答: 可以參考:http://stackoverflow.com/questions/4073969/copy-folder-structure-sans-files-from-one-location-to-another 

    親測有效:<code>    cd /path/to/directories &amp;&amp;</code>

the solutions are learning from http://blog.csdn.net/u013920434/article/details/53443757

解決方法:

方法一:

假設輸入為:

model.add(ZeroPadding2D((1, 1), batch_input_shape=(1, 3, img_width, img_height)))   

<code>将其改為</code><code>:</code>

model.add(ZeroPadding2D((1, 1), batch_input_shape=(1, img_width, img_height, 3)))  

方法二:

在網絡層明确指明:<code>image_dim_ordering,</code><code>即輸入圖像的次元次序</code><code>;</code>

<code>例如加上如下語句</code><code>:</code>

from keras import backend as K  

     if K.image_dim_ordering() == 'th':  

        model.add(ZeroPadding2D((1, 1), batch_input_shape=(1,3,img_width, img_height)))  

     else:  

        model.add(ZeroPadding2D((1, 1), batch_input_shape=(1,img_width, img_height,3)))  

<code>方法三</code><code>:</code><code>修改檔案’</code><code>~/.keras/keras.json’</code><code>中的’</code><code>tf</code><code>’</code><code>為’</code><code>th</code><code>’.</code>

<code>Reference:</code>

<code>http://stackoverflow.com/questions/39848466/tensorflow-keras-convolution2d-valueerror-filter-must-not-be-larger-than-t </code>