Keras VGG16 preprocess_input modes

后端 未结 3 2097
[愿得一人]
[愿得一人] 2021-01-04 10:34

I\'m using the Keras VGG16 model.

I\'ve seen it there is a preprocess_input method to use in conjunction with the VGG16 model. This method appears to call the prepr

3条回答
  •  再見小時候
    2021-01-04 11:13

    The mode here is not about the backend, but rather about on what framework the model was trained on and ported from. In the keras link to VGG16, it is stated that:

    These weights are ported from the ones released by VGG at Oxford

    So the VGG16 and VGG19 models were trained in Caffe and ported to TensorFlow, hence mode == 'caffe' here (range from 0 to 255 and then extract the mean [103.939, 116.779, 123.68]).

    Newer networks, like MobileNet and ShuffleNet were trained on TensorFlow, so mode is 'tf' for them and the inputs are zero-centered in the range from -1 to 1.

提交回复
热议问题