gpt4 book ai didi

keras - 什么时候应该使用 Keras 中的哪种数据格式约定(channels_last 或 channels_first)?

转载 作者:行者123 更新时间:2023-12-04 15:47:57 24 4
gpt4 key购买 nike

我是深度学习的新手,不知道什么时候应该使用哪种数据格式约定。根据https://keras.io/backend/ ,有两种数据格式约定。

channels_last 用于 2D 数据:(行、列、 channel )
channels_first:对于二维数据:(channels,rows,cols)

为什么 Keras 中有 channels_first 选项?我应该什么时候使用它? OpenCV 中使用 BGR 是否有任何历史原因?

" BGR was a choice made for historical reasons and now we have to live with it. In other words, BGR is the horse’s ass in OpenCV."
https://www.learnopencv.com/why-does-opencv-use-bgr-color-format/

最佳答案

我认为存在两种数据格式的原因是 Keras 也支持 Theano 作为另一个后端。在 Theano 中,第一个轴表示 channel 。

关于keras - 什么时候应该使用 Keras 中的哪种数据格式约定(channels_last 或 channels_first)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54953071/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com