Discussion:
Reading Matlab
Mathieu Dubois
2013-02-22 15:44:31 UTC
Permalink
Hello,

I wanted to use Octave to read a .mat file. The file format is version
7.3 i.e. HDF5 which I think is correct (I have opened it using python).
To my surprise, octave don't seem able to read it:

octave:3> load nyu_depth_v2_labeled.mat

warning: load: can't read `keys' (unknown datatype)

HDF5-DIAG: Error detected in HDF5 (1.8.4-patch1) thread 140297714808640:

#000: ../../../src/H5Dio.c line 174 in H5Dread(): can't read data

major: Dataset

minor: Read failed

<lot of other error messages>

octave:4> load -v7 nyu_depth_v2_labeled.mat

warning: load: found version 2 binary MAT file, but only prepared for version 1

error: load: invalid element type = 0

error: load: trouble reading binary file `nyu_depth_v2_labeled.mat'


Is there any way to read that type of files?

I'm using Octave 3.6.1 under Ubuntu 12.04.

Thanks in advance,
Mathieu
vinukn
2013-02-22 16:22:27 UTC
Permalink
Did you tried in new versions of octave, ie 3.6.2, 3.6.3 or 3.7.1+



--
View this message in context: http://octave.1599824.n4.nabble.com/Reading-Matlab-tp4650158p4650159.html
Sent from the Octave - General mailing list archive at Nabble.com.
Jordi Gutiérrez Hermoso
2013-02-22 16:28:17 UTC
Permalink
Post by vinukn
Did you tried in new versions of octave, ie 3.6.2, 3.6.3 or 3.7.1+
Don't try 3.7.1+ unless you're interested in participating in Octave
development. It's a development snapshot.

- Jordi G. H.
Mathieu Dubois
2013-02-22 18:31:07 UTC
Permalink
Hi,

I have compiled and installed 3.6.4 and I have the same errors.
octave:1> load nyu_depth_v2_labeled.mat
warning: load: can't read 'keys' (unknown datatype)
HDF5-DIAG: Error detected in HDF5 (1.8.4-patch1) thread 140677001172800:
#000: ../../../src/H5Dio.c line 174 in H5Dread(): can't read data
major: Dataset
minor: Read failed
so on>

Any idea? A quick googling in the error message suggest that this may be related to variable length strings (the mat file contains cell arrays of strings).

Mathieu

----- Mail original -----
Envoyé: Vendredi 22 Février 2013 17:28:17
Objet: Re: Reading Matlab
Post by vinukn
Did you tried in new versions of octave, ie 3.6.2, 3.6.3 or 3.7.1+
Don't try 3.7.1+ unless you're interested in participating in Octave
development. It's a development snapshot.
- Jordi G. H.
_______________________________________________
Help-octave mailing list
https://mailman.cae.wisc.edu/listinfo/help-octave
Mathieu Dubois
2013-02-22 23:06:30 UTC
Permalink
I have looked at the code in src/ls-hdf5.cc. The first problem(can't
read 'keys') seems to appear at line 526. The value of the type_class_id
is unknown: it is neither H5T_FLOAT, H5T_INTEGER, H5T_STRING, H5T_COMPOUND.

Printing it reveal that it has value 7 which according to HDF library
headers (H5Tpublic.h) means: H5T_REFERENCE.

For information I have Ubuntu 12.04 on a 64 bits system. Lib HDF5 is
version 1.8.4-patch1. I have compiled octave without any option to
configure.

Mathieu
Post by Mathieu Dubois
Hi,
I have compiled and installed 3.6.4 and I have the same errors.
octave:1> load nyu_depth_v2_labeled.mat
warning: load: can't read 'keys' (unknown datatype)
#000: ../../../src/H5Dio.c line 174 in H5Dread(): can't read data
major: Dataset
minor: Read failed
so on>
Any idea? A quick googling in the error message suggest that this may be related to variable length strings (the mat file contains cell arrays of strings).
Mathieu
----- Mail original -----
Envoyé: Vendredi 22 Février 2013 17:28:17
Objet: Re: Reading Matlab
Post by vinukn
Did you tried in new versions of octave, ie 3.6.2, 3.6.3 or 3.7.1+
Don't try 3.7.1+ unless you're interested in participating in Octave
development. It's a development snapshot.
- Jordi G. H.
_______________________________________________
Help-octave mailing list
https://mailman.cae.wisc.edu/listinfo/help-octave
_______________________________________________
Help-octave mailing list
https://mailman.cae.wisc.edu/listinfo/help-octave
Mathieu Dubois
2013-02-23 02:10:00 UTC
Permalink
Rethinking about it I wanted to re-ask the initial question: can octave
read matlab v7.3 files with the load command?
vinukn
2013-02-23 02:45:23 UTC
Permalink
Please report a bug.



--
View this message in context: http://octave.1599824.n4.nabble.com/Reading-Matlab-tp4650158p4650196.html
Sent from the Octave - General mailing list archive at Nabble.com.
John W. Eaton
2013-02-23 04:22:52 UTC
Permalink
Post by Mathieu Dubois
I have looked at the code in src/ls-hdf5.cc. The first problem(can't
read 'keys') seems to appear at line 526. The value of the type_class_id
is unknown: it is neither H5T_FLOAT, H5T_INTEGER, H5T_STRING, H5T_COMPOUND.
Printing it reveal that it has value 7 which according to HDF library
headers (H5Tpublic.h) means: H5T_REFERENCE.
For information I have Ubuntu 12.04 on a 64 bits system. Lib HDF5 is
version 1.8.4-patch1. I have compiled octave without any option to
configure.
The code in Octave for handling HDF5 files was written long before
Matlab's save function was changed to create HDF5 files, and is only
intended to read HDF5 files that Octave itself creates.

Are you interested in contributing code to support Matlab's new HDF5
save format? If so, let's discuss your plans on the maintainers list.

jwe
Mathieu Dubois
2013-02-24 21:17:33 UTC
Permalink
Post by John W. Eaton
Post by Mathieu Dubois
I have looked at the code in src/ls-hdf5.cc. The first problem(can't
read 'keys') seems to appear at line 526. The value of the type_class_id
is unknown: it is neither H5T_FLOAT, H5T_INTEGER, H5T_STRING,
H5T_COMPOUND.
Printing it reveal that it has value 7 which according to HDF library
headers (H5Tpublic.h) means: H5T_REFERENCE.
For information I have Ubuntu 12.04 on a 64 bits system. Lib HDF5 is
version 1.8.4-patch1. I have compiled octave without any option to
configure.
The code in Octave for handling HDF5 files was written long before
Matlab's save function was changed to create HDF5 files, and is only
intended to read HDF5 files that Octave itself creates.
Are you interested in contributing code to support Matlab's new HDF5
save format? If so, let's discuss your plans on the maintainers list.
I have think about it this week-end but I clearly don't have the time
now. However that could be a cool project so I will re-consider it in 1
month or so.

In the meantime I can take some time to read: is there any document
explaining how to add IO format to octave?

Mathieu
Post by John W. Eaton
jwe
_______________________________________________
Help-octave mailing list
https://mailman.cae.wisc.edu/listinfo/help-octave
Continue reading on narkive:
Loading...