Converting Theano-based Keras model definition to TensorFlow

后端 未结 1 923
眼角桃花
眼角桃花 2021-01-28 19:24

When converting Theano-based Keras model definition to TensorFlow, is it enough to change the order of input_shape on the input layer?

For example, the foll

相关标签:
1条回答
  • 2021-01-28 19:41

    Answer from Francois Chollet:

    I think the question means "what input_shape should I pass to my first layer given that I'm using TensorFlow and that my default setting for dim_ordering is "tf"". The answer is yep, that's how you do it, (img_width, img_height, 3).

    Important to note that if you want to load saved models that were trained with Theano with dim_ordering="th", into a model definition for TF with dim_ordering="tf", you will need to convert the convolution kernels. Keras has utils for that.

    0 讨论(0)
提交回复
热议问题