slambook icon indicating copy to clipboard operation
slambook copied to clipboard

第九章project/0.3 optimizer.optimize ( 10 )报错

Open dafei-qin opened this issue 7 years ago • 3 comments

在运行第九章project/0.3/bin/run_vo以及/project/0.4/bin/run_vo时,一旦程序调用optimizer.optimize ( 10 )就会报错,0.3版本会分提示: Assertion failed: (( ((internal::UIntPtr(m_data) % internal::traits<Derived>::Alignment) == 0) || (cols() * rows() * innerStride() * sizeof(Scalar)) < internal::traits<Derived>::Alignment ) && "data is not aligned"), function checkSanity, file /usr/local/lib/cmake/Sophus/../../../include/Eigen/src/Core/MapBase.h, line 191. Abort trap: 6 或者: run_vo(39088,0x7fff9f0a7340) malloc: *** mach_vm_map(size=9289677391957696512) failed (error code=3) *** error: can't allocate region *** set a breakpoint in malloc_error_break to debug libc++abi.dylib: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc Abort trap: 6 0.4版本提示为: run_vo(39086,0x7fff9f0a7340) malloc: *** mach_vm_map(size=9289450251538436096) failed (error code=3) *** error: can't allocate region *** set a breakpoint in malloc_error_break to debug libc++abi.dylib: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc Abort trap: 6

dafei-qin avatar Jan 19 '18 03:01 dafei-qin

内存对齐的问题,建议修改CMakeLists 为 set( CMAKE_CXX_FLAGS "-std=c++11" )

matheecs avatar May 01 '18 03:05 matheecs

问一下,第8章有遇到std::bad_alloc问题么?

roachsinai avatar Dec 05 '18 02:12 roachsinai

modify set( CMAKE_CXX_FLAGS "-std=c++11 -march=native -O3" ) to set( CMAKE_CXX_FLAGS "-std=c++11" ) for macos in CMakeLists.txt

PapaMadeleine2022 avatar Aug 09 '19 07:08 PapaMadeleine2022