Error in evaluating the ResidualBlock -> some values are Uninitialized

Skip to first unread message

Estelle Jiao

Apr 6, 2023, 2:12:22 PM4/6/23
to Ceres Solver
Hi guys,

I'm trying to use Ceres to solve a point cloud registration problem.  I've been trying to use Lie group and Lie Algebra for optimisation. By setting up a LocalParameterization and a Cost function, I tried to implement and got the following error: 

W20230407 02:01:52.933797 407544]

Error in evaluating the ResidualBlock.

There are two possible reasons. Either the CostFunction did not evaluate and fill all    
residual and jacobians that were requested or there was a non-finite value (nan/infinite)
generated during the or jacobian computation.

Residual Block size: 1 parameter blocks x 3 residuals

For each parameter block, the value of the parameters are printed in the first column  
and the value of the jacobian under the corresponding residual. If a ParameterBlock was
held constant then the corresponding jacobian is printed as 'Not Computed'. If an entry
of the Jacobian/residual array was requested but was not written to by user code, it is
indicated by 'Uninitialized'. This is an error. Residuals or Jacobian values evaluating
to Inf or NaN is also an error.  

Residuals:               -1           -1           -1

Parameter Block 0, size: 7

           0 |           -1           -1           -1
           0 |            0            0           -2
           0 |            0            2            2
           0 |            0            0            0
           0 |           -2           -2 Uninitialized
           0 |            2            0 Uninitialized
           0 |            0            0 Uninitialized

E20230407 02:01:52.934537 407544] Terminating: Residual and Jacobian evaluation failed.


I've got my code attached. It would be great to get some advice on this!


Sameer Agarwal

Apr 6, 2023, 2:33:30 PM4/6/23
The problem is that the jacobian for your cost function is 3x7 but you are only filling 18 out of those 21 values.

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
To view this discussion on the web visit
Reply all
Reply to author
0 new messages