如何将预处理层添加到预处理的咖啡因模型中?

发布于 2025-02-13 06:30:59 字数 286 浏览 0 评论 0原文

我有一个保存在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

扮仙女 2025-02-20 06:30:59

您可以添加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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文