Error in evaluating the ResidualBlock -> some values are Uninitialized

82 views
Skip to first unread message

Estelle Jiao

unread,
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 residual_block.cc:129]

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 trust_region_minimizer.cc:73] Terminating: Residual and Jacobian evaluation failed.

```

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

Thanks,
Estelle
ceres_test.cc

Sameer Agarwal

unread,
Apr 6, 2023, 2:33:30 PM4/6/23
to ceres-...@googlegroups.com
The problem is that the jacobian for your cost function is 3x7 but you are only filling 18 out of those 21 values.
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/c9ed0725-d7ae-455b-9bf1-7b772d23d166n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages