数据类型类:H5T_FLOAT F0413 08:54:40.661201 17769 hdf5_data_layer.cpp:53]检查失败:hdf_blobs_ [i]-& gt; shape(0)== num(1与1024) [英] Datatype class: H5T_FLOAT F0413 08:54:40.661201 17769 hdf5_data_layer.cpp:53] Check failed: hdf_blobs_[i] ->shape(0) == num (1 vs. 1024)

查看:184
本文介绍了数据类型类:H5T_FLOAT F0413 08:54:40.661201 17769 hdf5_data_layer.cpp:53]检查失败:hdf_blobs_ [i]-& gt; shape(0)== num(1与1024)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的数据集是一个HDF5文件,由形状为[129028,1,12,1024]data和形状为[129028,1,1,1]label组成. 但是,当我运行Solver.prototxt时,出现错误消息:

My data set is a HDF5 file consists of data with shape [129028,1,12,1024] and label of shape [129028,1,1,1].
But when I run solver.prototxt, I get the error message:

I0413 08:54:34.689985 17769 hdf5.cpp:32] Datatype class: H5T_FLOAT
F0413 08:54:40.661201 17769 hdf5_data_layer.cpp:53] Check failed:   
hdf_blobs_[i] ->shape(0) == num (1 vs. 1024) 
*** Check failure stack trace: ***

推荐答案

似乎您是从matlab中保存了hdf5的,而不是从python保存的(由您的此答案.

It looks like you saved your hdf5 from matlab, rather than python (judging by your previous question).
When saving data from Matlab one has to remember that Matlab stores multi-dimensions arrays in memory in colums-first fashion (fortran style), while python, caffe and many other applications expects multi-dimension arrays in row-first fashion (C style).
Thus, you need to permute the data in matlab before saving it to hdf5 for caffe. See this answer for more details.

我怀疑如果在存储的hdf5文件的shell中运行h5ls,您会注意到存储的数组的形状实际上是

I suspect that if you run h5ls in shell on the hdf5 file you stored you'll notice that the shape of the stored arrays are actually

data   [1024, 12, 1, 129028]
label  [1, 1, 1, 129028]

这篇关于数据类型类:H5T_FLOAT F0413 08:54:40.661201 17769 hdf5_data_layer.cpp:53]检查失败:hdf_blobs_ [i]-& gt; shape(0)== num(1与1024)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆