num_nonzeros_ >= 0 - problem too large?

38 views
Skip to first unread message

Matthias Bühlmann

unread,
Jun 23, 2021, 7:33:20 AM6/23/21
to Ceres Solver
I'm running into the following error:

block_sparse_matrix.cc:80 Check failed: num_nonzeros_ >= 0

Looks like an overflow problem. My problem size:

Parameters:       4608392
Residuals:        80739690
Parameter Blocks: 4409984
Residual Blocks:  80739690

Is this too big for ceres to handle?

Dmitriy Korchemkin

unread,
Jun 23, 2021, 8:07:46 AM6/23/21
to Ceres Solver
At this residual block count you have only ~26 values per jacobian of residual block.
NNZ value offsets are (signed) int32.

Matthias Bühlmann

unread,
Jun 23, 2021, 10:15:30 AM6/23/21
to ceres-...@googlegroups.com
Isn't that the non-zero count of the 'entire' jacobian for the whole problem?

--
You received this message because you are subscribed to a topic in the Google Groups "Ceres Solver" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ceres-solver/zSxjdjaclCY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/c88fb5a1-1550-4a4b-85f4-549fb49afcacn%40googlegroups.com.

Dmitriy Korchemkin

unread,
Jun 23, 2021, 11:14:26 AM6/23/21
to ceres-...@googlegroups.com
It is a maximum number of non-zero elements each sparse matrix can store.
And 2**31-1 / (Residual Blocks:  80739690) ~= 26 non-zero values per jacobian of residual block.

Depending on the linear solver you're using and preconditioner - there might be additional rows appended. So 26 is "upper bound".

It can also be an "overflow" of normal equations matrix (if the linear solver you're using explicitly computes it), it depends on fill-in pattern if the matrix of normal equations or jacobian overflows first.


You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/CAODMZ5g%2BoWn_ZeKwzy0WuBkhYBr%3DeofNKmPPdWGsx4c10Cf6iQ%40mail.gmail.com.


--
Dmitriy A Korchemkin

Sameer Agarwal

unread,
Jun 23, 2021, 12:03:33 PM6/23/21
to ceres-...@googlegroups.com
Matthias,
Yes this is too big. I took a whack at converting part of ceres to use 64bit ints in the past and that turned into quite a yak shaving so I gave up. 
Sameer


--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages