gpt4 book ai didi

Caffe:了解 blob 的预期 lmdb 数据结构

转载 作者:行者123 更新时间:2023-12-04 00:49:47 25 4
gpt4 key购买 nike

我试图了解如何在 Caffe 中解释数据。
为此,我查看了 Minst Tutorial
查看输入数据定义:

layers {
name: "mnist"
type: DATA
data_param {
source: "mnist_train_lmdb"
backend: LMDB
batch_size: 64
scale: 0.00390625
}
top: "data"
top: "label"
}

我现在查看了 mnist_train_lmdb 并获取了其中一个条目(以十六进制显示):
0801101C181C229006
00000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000
00000000000054B99F973C2400000000000000000000000000000000
000000000000DEFEFEFEFEF1C6C6C6C6C6C6C6C6AA34000000000000
00000000000043724872A3E3FEE1FEFEFEFAE5FEFE8C000000000000
000000000000000000000011420E4343433B15ECFE6A000000000000
00000000000000000000000000000000000053FDD112000000000000
000000000000000000000000000000000016E9FF5300000000000000
000000000000000000000000000000000081FEEE2C00000000000000
000000000000000000000000000000003BF9FE3E0000000000000000
0000000000000000000000000000000085FEBB050000000000000000
00000000000000000000000000000009CDF83A000000000000000000
0000000000000000000000000000007EFEB600000000000000000000
00000000000000000000000000004BFBF03900000000000000000000
0000000000000000000000000013DDFEA60000000000000000000000
00000000000000000000000003CBFEDB230000000000000000000000
00000000000000000000000026FEFE4D000000000000000000000000
00000000000000000000001FE0FE7301000000000000000000000000
000000000000000000000085FEFE3400000000000000000000000000
000000000000000000003DF2FEFE3400000000000000000000000000
0000000000000000000079FEFEDB2800000000000000000000000000
0000000000000000000079FECF120000000000000000000000000000
00000000000000000000000000000000000000000000000000000000
2807

(我在此处添加了换行符以便能够看到“7”数字。)

现在我的问题是, 这种格式在哪里描述? 或者换种方式定义前 36 个字节是某种报头,最后 8 个字节有一些标签对应关系?

我将如何构建自己的数据?
都没有 Blob Tutorial也不是 Layers Definition提供很多关于所需格式的信息。我的意图不是使用图像数据,而是时间序列

谢谢!

最佳答案

我意识到 Protocol Buffer 必须在这里发挥作用。因此,我尝试针对 caffe.proto 中定义的某些类型对其进行反序列化。 .

基准 似乎是完美的搭配:

{Caffe.Datum}
Channels: 1
Data: {byte[784]}
Encoded: false
FloatData: Count = 0
Height: 28
Label: 7
Width: 28

所以答案很简单: 它是按照 caffe.proto 定义的“数据”类型实例的序列化表示

顺便说一句。由于英语不是我的母语,我必须首先意识到“数据”是“数据”的单数形式

在使用您自己的数据时,其结构如下:

The conventional blob dimensions for data are number N x channel K x height H x width W. Blob memory is row-major in layout so the last / rightmost dimension changes fastest. For example, the value at index (n, k, h, w) is physically located at index ((n * K + k) * H + h) * W + w.



Blobs, Layers, and Nets: anatomy of a Caffe model供引用

关于Caffe:了解 blob 的预期 lmdb 数据结构,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29529959/

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