我一直在試圖將keras圖像暗淡爲了從tensorflow爲了theano順序改變。我修改~/.keras/keras.json
文件,該行"image_dim_ordering": "th"
不工作,但行"backend": "theano"
配置工作。keras「image_dim_ordering」配置不工作
{
"floatx": "float32",
"epsilon": 1e-07,
"backend": "theano",
"image_dim_ordering": "th"
}
當我在節目的開頭添加backend.image_dim_ordering('th')
,有在權重裝載一個新的問題。我確定重量是使用theano後端,並在「th」順序。
ValueError: Layer weight shape (3,3,3,64) not compatible with provided weight shape(64,3,3,3)
沒有backend.image_dim_ordering('th')
原來的錯誤在程序的開頭:
Exception: Layer weight shape (3, 3, 640, 64) not compatible with provided weight shape (64, 3, 3, 3)
我使用python 2.7.12,在Win7出現問題都和Ubuntu 16.04系統。
您使用的是Keras 2.0 API嗎?如果是,則'image_dim_ordering'被'image_data_format'替代。見[這裏](https://keras.io/backend/)。 –
謝謝,這有助於很多。 – patric
這是否解決了您的問題? –