Ace_Run
Ace_Run

Reputation: 1

can't disable ceres solver's output [miniglog]

I'm using ceres solver for a project, and when I call the ceres::Solve function, the library starts to output lines such as this one:

CHOLMOD version 3.0.11, May 4, 2016: Symbolic Analysis: status: OK
  Architecture: Linux
    sizeof(int):      4
    sizeof(SuiteSparse_long):  8
    sizeof(void *):   8
    sizeof(double):   8
    sizeof(Int):      4 (CHOLMOD's basic integer)
    sizeof(BLAS_INT): 4 (integer used in the BLAS)
  Results from most recent analysis:
    Cholesky flop count: 1.8667e+05
    Nonzeros in L:       18060
  memory blocks in use:           7
  memory in use (MB):           0.1
  peak memory usage (MB):       0.2
  maxrank:    update/downdate rank:   8
  supernodal control: 1 40 (supernodal if flops/lnz >= 40)
  nmethods:   number of ordering methods to try: 1
    method 0: natural
        flop count: 1.8667e+05
        nnz(L):     18060
  OK
block_sparse_matrix.cc:80 Allocating values array with 53208 bytes.
block_sparse_matrix.cc:80 Allocating values array with 53208 bytes.
block_sparse_matrix.cc:80 Allocating values array with 53208 bytes.
block_sparse_matrix.cc:80 Allocating values array with 53208 bytes.
reorder_program.cc:144 Block ordering stats:  flops: 8279 lnz  : 2253 anz  : 1972
block_sparse_matrix.cc:80 Allocating values array with 183816 bytes.
block_sparse_matrix.cc:80 Allocating values array with 53208 bytes.
compressed_row_sparse_matrix.cc:171 # of rows: 2217 # of columns: 2217 max_num_nonzeros: 17748. Allocating 221848

the setting is:

    ceres::Solver::Options options;
    options.max_num_iterations = 200;  // 200: max number of iterations
    options.linear_solver_type = ceres::SPARSE_NORMAL_CHOLESKY;
    options.logging_type = ceres::SILENT;
    options.minimizer_progress_to_stdout = false;
    options.function_tolerance = 1e-8;  // 1e-8: Minimizer terminates when (new_cost - old_cost) / old_cost < 1e-8;
    ceres::Solver::Summary summary;
    ceres::Solve(options, &problem, &summary);

Does someone have an idea on how to disable this annoying log?

Does someone have an idea on how to disable this annoying log?

Upvotes: 0

Views: 335

Answers (1)

Oliver Zendel
Oliver Zendel

Reputation: 2911

Ceres compiled with -DMINIGLOG=ON on a non-Android platform has the verbosity level baked into the library during compile-time (of ceres), all internal logging output goes to std::err:

https://github.com/ceres-solver/ceres-solver/blob/master/internal/ceres/miniglog/glog/logging.h

You should build ceres with a supplied glog (i.e. -DMINIGLOG=OFF) to have external control (e.g. google::SetVLOGLevel).

This also seems to be Google's policy: https://github.com/ceres-solver/ceres-solver/issues/630

Oh one more thing: The "CHOLMOD version ..." output on top originates from SuiteSparse/cholmod_check.c. This needs to be build with NPRINT to be silent

Upvotes: 0

Related Questions