且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Keras VGG16预处理输入模式

更新时间:2023-12-02 12:58:52

这里的mode与后端无关,而与有关模型在其上进行训练和移植的框架有关. keras链接中,指向VGG16:

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:

这些权重均来自牛津 VGG在牛津发布的权重 a>

因此,在Caffe中对VGG16和VGG19模型进行了训练,并将其移植到TensorFlow,因此在此处为mode == 'caffe'(范围为0到255,然后提取均值[103.939, 116.779, 123.68]).

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]).

较新的网络(例如 MobileNet ShuffleNet )在TensorFlow上进行了训练,因此mode'tf',并且输入在以下范围内为零中心-1至1.

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.