-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
Segfault in Read5 #40
Comments
Was the MAT file created using MATLAB? Which version of matio did you use? |
Any file to share? |
Sorry for the delay. You could get the file (350 Mb) from my OneDrive: https://1drv.ms/u/s!Apx8USiTtrYmoJRncwpfATtnCZLvuA Yes, the file is created from MATLAB, I tried reinstalling the latest matio, but same error. |
Thanks. Can reproduce and will investigate it. Do you have some MCOS objects inside the struct? It looks like it when watching the binary stream but I did not find it when opening it in MATLAB R14SP3. |
Don't know what MCOS objects are. I produced this file running R2015a with code from this repo: https://github.com/hbilen/WSDDN/blob/master/scripts/prepare_wsddn.m#L18 The produced saved model is fine if I run this code as is and fails if I remove drop6 and drop7 from the list (the objects from the list get saved in the produced file in the end). That's the code for producing this part of the object to be saved: https://github.com/vlfeat/matconvnet/blob/91399d47fcfcd06836f30ee3d88fcc7116ae40e0/matlab/%2Bdagnn/%40DagNN/saveobj.m |
Yes, that is exactely what I mean by MCOS (MATLAB Class Object System). These class objects are currently not supported. |
In my understanding is that matconvnet's code converts the DagNN object to plain struct before saving: matio reads the saved file OK when it's saved with '-v6'. |
But
gives some strange trailing 88 bytes variable for the MCOS. |
Anyway, I will investigate further. Done this a few times previously. It is a tedious byte-by-byte comparison of the zlib-inflated v7 and the v6 MAT-file which usually gives the hint where matio uncompressing is faulty. |
Would you like me to upload the working v6 file? (though I'm not sure it would be bitwise equivalent, the weights in the model could be slightly different) |
Thanks. I already created it myself using old MATLAB R14SP3.
|
The/one error is reproducable if only net.layers is saved. Reduces the file size significantly. |
I guess this loop is to blame: Yet it goes fine with -v6... |
Oops, there is |
"ClassName = class(object) returns a string specifying the class of object." (http://fr.mathworks.com/help/matlab/ref/class.html) And it's indeed a byte vector when I read the file saved with -v6... |
Right. Nothing to blame. |
|
It should be just an integer. 2016-07-11 21:36 GMT+02:00 tbeu [email protected]:
Vadim Kantorov |
Well, it looks like an empty field. |
When I load the buggy file, it's somehow a gpuArray:
ans = gpuArray |
Yes, confirmed. Where is it saved (in m source)? |
Both the v6 and the v7 MAT-file have MCOS ... gpuArray in the binary stream there. |
Yep, what's happening is that in the model there's a custom layer (a MCOS) that gets serialized at the block.save() call https://github.com/vlfeat/matconvnet/blob/91399d47fcfcd06836f30ee3d88fcc7116ae40e0/matlab/%2Bdagnn/%40DagNN/saveobj.m#L42 What's surprising is that if I keep drop6 and drop7 objects in the graph, then both v6 and v7 version produce a readable file. |
At least it should not crash on such data. Going to try to handle this exception. |
Thanks! By the way, can this github project be considered as the official matio home? |
This is my mirror of the official matio from sf.net. Once I file a new release I push to the sf.net repo and prepare the release there. |
…e class * Skip unknown/undocumented opaque class * As reported by #40
You wanna test if 3b6dc8f works for you where the unknown MCOS class is skipped now. |
I'll check it later tonight! |
The file doesn't break anymore, LGTM. |
Since reading works I am going to close this issue and move the existing writing problems for #47. |
…e class * Skip unknown/undocumented opaque class * As reported by tbeu#40
* As reported by tbeu#40
* As reported by tbeu#40
Hi, I'm reading a MatLab file with Torch wrapper for matio and getting a Segfault at https://github.com/tbeu/matio/blob/master/src/mat5.c#L4331.
The file I'm loading is a few hundred megabytes, but I could provide it if needed. Thanks!
The text was updated successfully, but these errors were encountered: