FS#77705 - python-opencv 4.7 results in core dump when opening ONNX model
Attached to Project:
Arch Linux
Opened by Cecil Watson (cesman) - Friday, 03 March 2023, 01:55 GMT
Last edited by Antonio Rojas (arojas) - Monday, 29 May 2023, 00:27 GMT
Opened by Cecil Watson (cesman) - Friday, 03 March 2023, 01:55 GMT
Last edited by Antonio Rojas (arojas) - Monday, 29 May 2023, 00:27 GMT
|
Details
Description:
After upgrading to opencv 4.7 and python-opencv 4.7, I noted an error with loading an model I made in YOLO and converted to ONNX no longer working. This had previous worked with no issues w/ opencv 4.6. If I revert to 4.6 it still functions (well it didn't up until yesterday when I assume a dependent library got updated and 4.6 no longer funtions). Here is the error I see: /usr/include/c++/12.2.1/bits/stl_vector.h:1123: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = float; _Alloc = std::allocator<float>; reference = float&; size_type = long unsigned int]: Assertion '__n < this->size()' failed. /usr/include/c++/12.2.1/bits/stl_vector.h:1123: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_tyAborted (core dumped) If I create a venv and install opencv-python (which pulls down 4.7.0.68), activate it and run the script, the script functions without issue. So I don't believe this is an upstream issue. Additional info: * package version(s) opencv-cuda-4.7.-03 and python-opencv-4.7.0-3 * config and/or log files etc. * link to upstream bug report, if any Steps to reproduce: sudo pacman -Sy opencv-cuda python-opencv I've uploaded the python script and model here: https://drive.google.com/drive/folders/1i_aqCIovVoC6ufG1b8e-S6ELNG9DEMp3?usp=share_link python yv5_cls.py core dumps python -m venv ~/path/to/venv/opencv47 activate ~/path/to/venv/opencv47/bin/activate python yv_cls.py woks as expected |
This task depends upon
Closed by Antonio Rojas (arojas)
Monday, 29 May 2023, 00:27 GMT
Reason for closing: Fixed
Additional comments about closing: opencv 4.7.0-11
Monday, 29 May 2023, 00:27 GMT
Reason for closing: Fixed
Additional comments about closing: opencv 4.7.0-11
Does a backtrace with debug symbols [1] shed any light? Please post it.
PS. that Google link requires a login. It's no good.
[1] https://wiki.archlinux.org/title/Debugging/Getting_traces#Debuginfod
https://drive.google.com/drive/folders/1i_aqCIovVoC6ufG1b8e-S6ELNG9DEMp3?usp=sharing
I'm attempting to debug now. It is downloading debug info for various files and it is taking some time. I'll post once I have the information.
-DBUILD_WITH_DEBUG_INFO=OFF
Is that the reason for missing symbols?
Anyway: this is an assert, please report it upstream. The pypi package is not affected because it's likely compiled without asserts, but this is still an upstream problem.
https://github.com/opencv/opencv/issues/23323
The response so far is suggesting perhaps a broken build.
warning: File "/usr/lib/debug/usr/lib/libopencv_core.so.4.7.0.debug" has a different build-id, file skipped
warning: File "/usr/lib/debug/.build-id/34/60fea22215db892edccc0732ff15fbee7d63d6.debug" has a different build-id, file skipped
warning: the debug information found in "/usr/lib/debug//usr/lib/libopencv_core.so.4.7.0.debug" does not match "/usr/lib/libopencv_core.so.407" (CRC mismatch).
warning: the debug information found in "/usr/lib/debug//usr/lib/libopencv_core.so.4.7.0.debug" does not match "/usr/lib/libopencv_core.so.407" (CRC mismatch).
I've attached the trace.