The matrix contains only 1 in some elements (unsigned char format). So far as I understand, the file should be filled by triplets: 2 indices + value. 145, 0, 1 looks fine. Further - complete nonsense. In any case -1 shouldn't be here. I blame large indices (see 'sizes:'). Mat simply crashes with such numbers. The program aborts at start. SparseMat works, but this way. May it be the reason and what is the limit for sizes?