Unknown mat file type, version 100, 105 - Octave

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Unknown mat file type, version 100, 105 - Octave

June Wang
Hello,
I just generated a .mat model using octave. But when I load it through scipy.io.loadmat('myfile.mat') in python, it says:
...
File "C:\Users\junew\Miniconda3\envs\tf_1.14.0\lib\site-packages\scipy\io\matlab\miobase.py", line 241, in get_matfile_version
    raise ValueError('Unknown mat file type, version %s, %s' % ret)
ValueError: Unknown mat file type, version 100, 105

Could anyone help on this please? Thank you

Jun


Reply | Threaded
Open this post in threaded view
|

Re: Unknown mat file type, version 100, 105 - Octave

siko1056
On 8/26/19 2:30 PM, June Wang wrote:

> Hello,
> I just generated a .mat model using octave. But when I load it through
> scipy.io.loadmat('myfile.mat') in python, it says:
> ...
> File
> "C:\Users\junew\Miniconda3\envs\tf_1.14.0\lib\site-packages\scipy\io\matlab\miobase.py",
> line 241, in get_matfile_version
>     raise ValueError('Unknown mat file type, version %s, %s' % ret)
> ValueError: Unknown mat file type, version 100, 105
>
> Could anyone help on this please? Thank you
>
> Jun
>

scipy.io.loadmat [1] seems to handle only Matlab input.  Thus make sure
to save your data using Matlab output "-v7" [2] from Octave:

   save -v7 myfile.mat ...

By default "-text" is used by Octave.

HTH,
Kai

[1]
https://docs.scipy.org/doc/scipy/reference/generated/scipy.io.loadmat.html
[2]https://octave.org/doc/v5.1.0/XREFsave.html