tmbdev/clstm

segfault when deserializing models from separate_derivs branch

mittagessen opened this issue · 4 comments

I haven't really investigated this further as there are other reasons for me not to use the main branch yet (and I really hate C++) but loading models created with the separate_derivs branch causes a segmentation fault in the net_of_proto function in clstm_proto. Here's a stack trace produced from a minimal program (just use clstmocr to reproduce):


#6  ocropus::net_of_proto (proto=0x5555557caa20) at clstm_proto.cc:108
#7  0x000055555557dc34 in ocropus::net_of_proto (proto=0x5555557d01c0) at clstm_proto.cc:132
#8  0x000055555557dc34 in ocropus::net_of_proto (proto=proto@entry=0x5555557cd900) at clstm_proto.cc:132
#9  0x000055555557e983 in ocropus::read_as_proto (stream=...) at clstm_proto.cc:172
#10 ocropus::load_as_proto (fname=...) at clstm_proto.cc:179
#11 0x000055555555fbbe in ocropus::load_net (file=...) at clstm.cc:679
#12 0x000055555555bd93 in main (argc=<optimized out>, argv=<optimized out>) at test-load.cc:28

One of the offending model files is [0].

[0] syriac.clstm

Did you try this tagged version?
https://github.com/tmbdev/clstm/tree/a588c8

That one actually works. I'll do some bisecting tomorrow.

The commit introducing the bug seems to be 41c4424. It seem to be related to deprecation of the name attribute. I'll compare some old and new messages next.

The source of all this trouble is a renaming of the layers and weights introduced by the above commit. As it is probably not worth the trouble to drag these legacy layer identifiers along, I'll just write a small utility to reserialize the models I've got to the new format.