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

MAT.jl can't find 'MATLAB_class' #128

Open
Tokazama opened this issue Nov 14, 2019 · 5 comments
Open

MAT.jl can't find 'MATLAB_class' #128

Tokazama opened this issue Nov 14, 2019 · 5 comments

Comments

@Tokazama
Copy link
Member

Tokazama commented Nov 14, 2019

I get the following error when I use matread from the MAT.jl package.

HDF5-DIAG: Error detected in HDF5 (1.10.4) thread 0:
  #000: H5A.c line 425 in H5Aopen(): unable to load attribute info from object header for attribute: 'MATLAB_class'
    major: Attribute
    minor: Can't open object
  #001: H5Aint.c line 478 in H5A__open(): unable to load attribute info from object header for attribute: 'MATLAB_class'
    major: Attribute
    minor: Can't open object
  #002: H5Oattribute.c line 515 in H5O__attr_open_by_name(): can't locate attribute: 'MATLAB_class'
    major: Attribute
    minor: Object not found
ERROR: Error opening attribute /#subsystem#/MATLAB_class
Stacktrace:
 [1] error(::String, ::String, ::String, ::String) at ./error.jl:42
 [2] h5a_open at /Users/Zach/.julia/packages/HDF5/Zh9on/src/HDF5.jl:2279 [inlined]
 [3] a_open(::HDF5.HDF5Group, ::String) at /Users/Zach/.julia/packages/HDF5/Zh9on/src/HDF5.jl:852
 [4] a_read(::HDF5.HDF5Group, ::String) at /Users/Zach/.julia/packages/HDF5/Zh9on/src/HDF5.jl:1269
 [5] m_read(::HDF5.HDF5Group) at /Users/Zach/.julia/packages/MAT/mPSjZ/src/MAT_HDF5.jl:198
 [6] read(::MAT.MAT_HDF5.MatlabHDF5File, ::String) at /Users/Zach/.julia/packages/MAT/mPSjZ/src/MAT_HDF5.jl:261
 [7] read(::MAT.MAT_HDF5.MatlabHDF5File) at /Users/Zach/.julia/packages/HDF5/Zh9on/src/datafile.jl:45
 [8] matread(::String) at /Users/Zach/.julia/packages/MAT/mPSjZ/src/MAT.jl:133
 [9] top-level scope at REPL[6]:1

The errors from HDF5 are pretty clear but I don't know why this is an issue with the file I have because it's doesn't seem to be improperly formatted. I was able to get it to load in Matlab fine and followed the instructions here to ensure that I have a supported file type. Which produce 'MATLAB 7.3 MAT-file, Platform: GLNXA64, Created on: Thu Aug 15 10:14:40 2019 HDF5 schema 1.00 . .

Update:
I've gone back through and tried to figure out what's wrong. For some reason a mat file with these variables loads fine:

  • all_id : 1065x1 double
  • loaded_bd_network : 68x68x1065 logical
  • loaded_tensor : 4-D double
  • mode3 : 1x20 cell

But these variables error:

  • all_id : 1997x1 string
  • loaded_bd_network : 68x68x1997 logical
  • loaded_tensor : 4-D double
  • mode3 : 1x8 cell
@iuliancioarca
Copy link

I also have this problem. I did some trials and the error appears only for -v7.3 format, when I have a datetime object inside.

@Gravios
Copy link

Gravios commented Mar 25, 2020

I'm also in the same situation. Though there are no datetime objects in my mat files.

@Tokazama
Copy link
Member Author

It may be worth mentioning that any file I've encountered this error with here also doesn't open in anything but Matlab. In other words, I can't open it in Python or R.

@Gravios
Copy link

Gravios commented Mar 25, 2020

Hmm, strange, I've managed to open them in python3 using h5py. I'll dig into it on the weekend. I'll make some test files and try and spot the difference.

@jebej
Copy link
Contributor

jebej commented Jul 7, 2020

Could you try with the branch from this PR to see if you can load the file? It won't make any unsupported types work, but at least the rest of the file will be readable.

In julia:

]add https://github.com/jebej/MAT.jl.git#patch-1

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

4 participants