Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data type Error while running basset_train.lua #25

Closed
SamMondal opened this issue Oct 26, 2016 · 10 comments
Closed

Data type Error while running basset_train.lua #25

SamMondal opened this issue Oct 26, 2016 · 10 comments

Comments

@SamMondal
Copy link

Hi Dave,
I followed the instructions mentioned in the tutorial file: new_data_iso.ipynb
Then ran this:
$ basset_train.lua -job params.txt -save mg_dnase_cnn learn_mg_dnase.h5
(previously, learn_mg_dnase.bed, learn_mg_dnase_act.txt, learn_mg_dnase.fa and learn_mg_dnase.h5 were created as per the instructions with your scripts)
I get this error message : "ffi.lua:332: Cannot support reading float data with size = 2 bytes"
Question: Is this error related to the datatype in the .h5 file?
Could you please suggest something?
Thanks!

(Please see the error details below)

{}
nn.Sequential {
input -> (1) -> (2) -> (3) -> (4) -> (5) -> (6) -> (7) -> (8) -> (9) -> output: nn.SpatialConvolution(4 -> 10, 10x1)
(2): nn.SpatialBatchNormalization
(3): nn.ReLU
(4): nn.Reshape(5910)
(5): nn.Linear(5910 -> 500)
(6): nn.BatchNormalization
(7): nn.ReLU
(8): nn.Linear(500 -> 9)
(9): nn.Sigmoid
}
/home/sam/softwares/torch/install/bin/luajit: ...e/sam/softwares/torch/install/share/lua/5.1/hdf5/ffi.lua:332: Cannot support reading float data with size = 2 bytes
stack traceback:
[C]: in function 'error'
...e/sam/softwares/torch/install/share/lua/5.1/hdf5/ffi.lua:332: in function '_getTorchType'
...m/softwares/torch/install/share/lua/5.1/hdf5/dataset.lua:88: in function 'getTensorFactory'
...m/softwares/torch/install/share/lua/5.1/hdf5/dataset.lua:138: in function 'partial'
/home/sam/softwares/basset/src/batcher.lua:31: in function 'next'
/home/sam/softwares/basset/src/convnet.lua:884: in function 'train_epoch'
/home/sam/softwares/basset/src/basset_train.lua:148: in main chunk
[C]: in function 'dofile'
...ares/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00405d50

Epoch # 1

@davek44
Copy link
Owner

davek44 commented Oct 28, 2016

As far as you can tell, did the torch-hdf5 library install properly? Can you start torch and import it?

Alternatively, what version of HDF5 do you have installed? I noticed awhile back that the newest version caused a few things to break.

@SamMondal
Copy link
Author

SamMondal commented Oct 28, 2016

Thanks Dave. My whole new-bie exposure to lua and torch is through Basset. I hope I am not super messy here:

  1. I could start torch and import hdf5 with: require 'hdf5'
    Unlike python's import, it's not silent, rather prints a lengthy details which I am not sure if is an error message. (please see below)
    UPDATE EDIT:
    th> require 'hdf5';
    was silent, and imported it.
  2. HDF5 version: 1.8.16
    sam@ubuntu-supermicro:~$ dpkg -l | grep hdf5

ii hdf5-helpers 1.8.16+docs-4ubuntu1 amd64 Hierarchical Data Format 5 (HDF5) - Helper tools
ii hdf5-tools 1.8.16+docs-4ubuntu1 amd64 Hierarchical Data Format 5 (HDF5) - Runtime tools
ii libhdf5-10:amd64 1.8.16+docs-4ubuntu1 amd64 Hierarchical Data Format 5 (HDF5) - runtime files - serial version
ii libhdf5-cpp-11:amd64 1.8.16+docs-4ubuntu1 amd64 Hierarchical Data Format 5 (HDF5) - C++ libraries
ii libhdf5-dev 1.8.16+docs-4ubuntu1 amd64 Hierarchical Data Format 5 (HDF5) - development files - serial version
ii libhdf5-serial-dev 1.8.16+docs-4ubuntu1 all transitional dummy package

sam@ubuntu-supermicro:~/softwares/basset/data/dnase_bed_files$ th

______ __ | Torch7
/_ / ________/ / | Scientific computing for Lua.
/ / / _ / / __/ _ \ | Type ? for help
/_/ _
// __///_/ | https://github.com/torch
| http://torch.ch

th> require 'hdf5'
{
H5Z_FILTER_CONFIG_ENCODE_ENABLED : 1
H5F_ACC_RDWR : 1
_getTorchType : function: 0x419b5b18
H5F_OBJ_FILE : 1
H5S_ALL : 0
H5F_OBJ_GROUP : 4
C : userdata: 0x405bbc28
H5P_DEFAULT : 0
_describeObject : function: 0x4161ff98
H5Z_FILTER_NBIT : 5
_debugMode : false
_getObjectType : function: 0x4161ff58
H5F_OBJ_ALL : 31
_getObjectName : function: 0x419b5b38
version :
{
1 : 1
2 : 8
3 : 17
}
H5Z_FILTER_SHUFFLE : 2
HDF5Group : {...}
open : function: 0x419ae3a0
H5Z_FILTER_SZIP : 4
H5F_OBJ_ATTR : 16
H5Z_FILTER_FLETCHER32 : 3
H5F_OBJ_DATATYPE : 8
debugMode : function: 0x405a9a78
H5F_ACC_EXCL : 4
H5Z_FILTER_NONE : 0
_testUtils :
{
deepAlmostEq : function: 0x405a9a38
withTmpDir : function: 0x405aee70
}
_nativeTypeForTensorType : function: 0x419b5ab0
H5F_ACC_TRUNC : 2
_config :
{
HDF5_INCLUDE_PATH : "/home/sam/softwares/anaconda2/include"
HDF5_LIBRARIES : "/home/sam/softwares/anaconda2/lib/libhdf5.so;/home/sam/softwares/anaconda2/lib/libhdf5_hl.so;/home/sam/softwares/anaconda2/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/librt.so;/usr/lib/x86_64-linux-gnu/libpthread.so;/home/sam/softwares/anaconda2/lib/libz.so;/usr/lib/x86_64-linux-gnu/libdl.so;/usr/lib/x86_64-linux-gnu/libm.so"
}
_loadObject : function: 0x419ae380
DataSetOptions : {...}
HDF5DataSet : {...}
H5Z_FILTER_RESERVED : 256
_logger :
{
error : function: 0x41d1d788
warn : function: 0x41d1d788
debug : function: 0x41d1d7d0
}
H5F_ACC_RDONLY : 0
_fletcher32Available : function: 0x4161ffb8
H5Z_FILTER_CONFIG_DECODE_ENABLED : 2
ffi :
{
abi : function: builtin#202
copy : function: builtin#200
errno : function: builtin#198
typeinfo : function: builtin#193
alignof : function: builtin#196
cdef : function: builtin#189
C : userdata: 0x40e375f0
cast : function: builtin#191
load : function: builtin#205
offsetof : function: builtin#197
sizeof : function: builtin#195
string : function: builtin#199
metatype : function: builtin#203
new : function: builtin#190
arch : "x64"
os : "Linux"
gc : function: builtin#204
fill : function: builtin#201
istype : function: builtin#194
typeof : function: builtin#192
}
H5Z_FILTER_ERROR : -1
_outputTypeForTensorType : function: 0x41b53858
H5Z_FILTER_MAX : 65535
h5t :
{
STD_B32LE : 50331728
IEEE_F32BE : 50331703
NATIVE_B16 : 50331694
NATIVE_HSIZE : 50331698
NO_CLASS : -1
NATIVE_UINT_FAST32 : 50331681
STD_B8LE : 50331724
STD_I64BE : 50331715
NATIVE_LONG : 50331662
NATIVE_DOUBLE : 50331691
TIME : 2
NATIVE_INT16 : 50331670
NATIVE_LLONG : 50331688
STD_I8BE : 50331709
STD_B64LE : 50331730
NATIVE_HSSIZE : 50331699
STD_B32BE : 50331729
INTEGER : 0
NATIVE_INT64 : 50331682
STD_I8LE : 50331708
STD_I32LE : 50331712
NATIVE_SCHAR : 50331656
NATIVE_INT_FAST16 : 50331674
NATIVE_INT : 50331660
BITFIELD : 4
NATIVE_UINT_LEAST16 : 50331673
NATIVE_INT_LEAST16 : 50331672
IEEE_F64LE : 50331704
NATIVE_INT_FAST64 : 50331686
NATIVE_UINT_FAST64 : 50331687
NATIVE_UINT_LEAST64 : 50331685
NATIVE_INT_LEAST64 : 50331684
ENUM : 8
NATIVE_UINT64 : 50331683
NATIVE_HBOOL : 50331701
NATIVE_ULONG : 50331663
NATIVE_INT_FAST32 : 50331680
NATIVE_HADDR : 50331697
NATIVE_UINT : 50331661
NCLASSES : 11
NATIVE_UINT_LEAST32 : 50331679
NATIVE_INT_LEAST32 : 50331678
STD_U64LE : 50331722
NATIVE_UINT32 : 50331677
NATIVE_SHORT : 50331658
NATIVE_INT32 : 50331676
VLEN : 9
ARRAY : 10
STD_U16LE : 50331718
STD_B16LE : 50331726
STD_I64LE : 50331714
NATIVE_UINT16 : 50331671
NATIVE_UINT_FAST8 : 50331669
STD_B16BE : 50331727
NATIVE_INT_FAST8 : 50331668
FLOAT : 1
REFERENCE : 7
STD_U32LE : 50331720
NATIVE_USHORT : 50331659
NATIVE_ULLONG : 50331689
NATIVE_INT8 : 50331664
IEEE_F32LE : 50331702
STD_U8BE : 50331717
NATIVE_INT_LEAST8 : 50331666
NATIVE_UINT8 : 50331665
NATIVE_B32 : 50331695
NATIVE_HERR : 50331700
NATIVE_OPAQUE : 50331736
NATIVE_LDOUBLE : 50331692
NATIVE_UINT_LEAST8 : 50331667
COMPOUND : 6
STD_REF_OBJ : 50331739
NATIVE_UINT_FAST16 : 50331675
NATIVE_B64 : 50331696
STD_U16BE : 50331719
STD_REF_DSETREG : 50331740
NATIVE_B8 : 50331693
STD_I32BE : 50331713
IEEE_F64BE : 50331705
NATIVE_FLOAT : 50331690
NATIVE_UCHAR : 50331657
STD_U32BE : 50331721
OPAQUE : 5
STD_B64BE : 50331731
STD_U8LE : 50331716
STD_I16BE : 50331711
STD_B8BE : 50331725
STRING : 3
STD_I16LE : 50331710
STD_U64BE : 50331723
}
HDF5File : {...}
H5Z_FILTER_SCALEOFFSET : 6
H5Z_FILTER_DEFLATE : 1
H5F_ACC_CREAT : 16
H5F_UNLIMITED : 18446744073709551615ULL
_deflateAvailable : function: 0x41620000
_inDebugMode : function: 0x419ae360
H5F_OBJ_LOCAL : 32
H5S_SELECT_SET : 0
_datatypeName : function: 0x419b5798
H5F_ACC_DEBUG : 8
H5F_OBJ_DATASET : 2
}
[0.1963s]
th>

@davek44
Copy link
Owner

davek44 commented Oct 28, 2016

Hmm OK that all looks fine. Could you send me your HDF5 file to test on my system? Maybe the files that you used to make it, too, if that's not too challenging.

@SamMondal
Copy link
Author

I have sent a link to the files uploaded on google-drive to your email id (mentioned in the basset paper).
Thanks a lot!

@davek44
Copy link
Owner

davek44 commented Nov 4, 2016

It seems to be working fine for me. Maybe try re-installing the torch-hdf5 package; you must have the wrong one somehow.

Run the following commands in the "src" directory":

  1. git clone https://github.com/davek44/torch-hdf5.git
  2. cd torch-hdf5
  3. luarocks make

And try running again.

@SamMondal
Copy link
Author

Dave, I did what you suggested! And it's working! Thanks a lot again!

@davek44
Copy link
Owner

davek44 commented Nov 4, 2016

Great to hear. I had to modify DeepMind's version of the torch-hdf5 code a bit to enable 2 byte floats, so you must've installed their version instead of mine.

@davek44 davek44 closed this as completed Nov 4, 2016
@SamMondal
Copy link
Author

yeah, spot on! I saw that somehow both theirs and yours were co-existing and there was a conflict. Got rid of both first, and then reinstalled yours one.

@YZJenny
Copy link

YZJenny commented Dec 14, 2018

I also run the your suggested commands in the "src" directory" . It did success to solve the problem 'Cannot support reading float data with size = 2 bytes',
But it merged new error like this : ~/torch/install/share/lua/5.1/hdf5/ffi.lua:71: Unsupported HDF5 version: 1.10.1

Could you please suggest something?
Thanks!

@davek44
Copy link
Owner

davek44 commented Dec 27, 2018

Yea HDF 1.10 breaks the DeepMind library. I use HDF 1.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants