gpt4 book ai didi

machine-learning - 如何在caffe中将hdf5格式转换为caffemodel格式?

转载 作者:行者123 更新时间:2023-11-30 08:41:14 25 4
gpt4 key购买 nike

基本上我使用caffe进行深度学习。现在,我为自己的数据集微调了网络,并将模型保存为 hdf5 格式(扩展名为 .h5)。

现在我想使用 matcaffe 对图像进行分类。 matcaffe 仅理解训练模型的 .caffemodel 格式。
那么有没有办法将hdf5文件转换为caffemodel?

最佳答案

您可以在 solver.prototxt 中设置 caffemodel 文件的首选格式。只需设置即可

snapshot_format: BINARYPROTO

参见caffe.proto了解更多信息。

<小时/>

或者,您可以使用 python 接口(interface) ( which is by far better than the matlab interface for caffe, IMHO ):

import caffe
net = caffe.Net('/path/to/deploy.prototxt', '/path/to/caffemodel.h5', caffe.TEST)
net.save('/path/to/just.caffemodel')

关于machine-learning - 如何在caffe中将hdf5格式转换为caffemodel格式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38038933/

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