在 caffe net 中读取 lmdb 文件时出错
Error reading lmdb file in caffe net
我正在尝试使用我创建的 LMDB 文件在 caffe net 中定义数据层,但出现以下错误
TypeError: 'LMDB' has type (type 'str'), but expected one of: (type 'int', type 'long')
我检查了传递给生成 lmdb 文件的脚本的文本文件中的标签 (caffe/build/tools/convert_imageset
)。
我在这里遗漏了什么吗?
编辑-1:
这是我的数据层定义:
n.data,n.labels = L.Data(batch_size = batch_size,
source=lmdb_src,
backend = "LMDB",
transform_param = dict(mean_file = mean_file),
ntop=2)
您正在尝试设置
backend: "LMDB"
在您的净定义中,而不是
backend: LMDB
请注意 LMDB
不是 作为字符串传递,而是作为枚举整数传递。
你应该做的是设置
backend = caffe.Data.LMDB
使用caffe protobuff定义设置的枚举值。
我正在尝试使用我创建的 LMDB 文件在 caffe net 中定义数据层,但出现以下错误
TypeError: 'LMDB' has type (type 'str'), but expected one of: (type 'int', type 'long')
我检查了传递给生成 lmdb 文件的脚本的文本文件中的标签 (caffe/build/tools/convert_imageset
)。
我在这里遗漏了什么吗?
编辑-1: 这是我的数据层定义:
n.data,n.labels = L.Data(batch_size = batch_size,
source=lmdb_src,
backend = "LMDB",
transform_param = dict(mean_file = mean_file),
ntop=2)
您正在尝试设置
backend: "LMDB"
在您的净定义中,而不是
backend: LMDB
请注意 LMDB
不是 作为字符串传递,而是作为枚举整数传递。
你应该做的是设置
backend = caffe.Data.LMDB
使用caffe protobuff定义设置的枚举值。