如何将预处理层添加到预处理的咖啡因模型中?
我有一个保存在Caffe中的预训练的图像分类模型,该模型有望获得灰度(一个通道)图像。我想在仅向模型提供RGB(三个通道)输入的工具中使用此模型。不可能更改该工具提供图像的方式,因此我想在输入层之前添加一层仅将输入转换为一个通道,这在Caffe中是否可以?以及如何?
我正在寻找一种解决方案,该解决方案不需要在可能的情况下定义新层即可咖啡。
请注意,我具有模型的“ .prototxt”和“合并”文件。
我以前在Tensorflow中做过类似的事情,但我不知道这在Caffe中是否可以使用,并且在网上找不到太多材料。
I have a pre-trained image classification model saved in caffe, the model is expected to get grayscale(one channel) images. I want to use this model in a tool that only provides input of RGB(three channels) to the model. It is not possible to change the way this tool provides images so I thought of adding a layer before the input layer that transforms the input to one channel only, is that possible in caffe? and how?
I'm looking for a solution that doesn't require to define new layers to caffe if possible.
Note that I have the ".prototxt" and the ".weights" files of the model.
I previously did a similar thing in tensorflow but I don't know if this is possible in caffe and didn't find much material online.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以添加
python
层为您做。什么是
python
layer 。可以找到这样一层的示例在这里。
You can add a
Python
layer to do it for you.What is a
Python
layer.An example of such a layer can be found here.