-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Failing Test_Caffe_layers not calling UpgradeNetAsNeeded for external ProtoBuf, building on Guix #18702
Description
System information (version)
- OpenCV => 3.4.12
- Operating System / Platform => GNU Guix up to date at 24/10/2020
- Compiler => gcc 7.5.0
Detailed description
First, thanks for the amazing work you do!
I'm upgrading Guix's OpenCV package from 3.4.3 to 3.4.12, and running into a test failure that I cannot diagnose further. The Test_Caffe_layers.{Accum,DataAugmentation,Resample,Correlation} all fail with the following message (only reproduced for Accum):
[ RUN ] Test_Caffe_layers.Accum/0, where GetParam() = OCV/CPU
[libprotobuf ERROR google/protobuf/text_format.cc:309] Error parsing text-format opencv_caffe.NetParameter: 22:15: Message type "opencv_caffe.LayerParameter" has no field named "accum_param".
unknown file: Failure
C++ exception with description "OpenCV(3.4.12) /tmp/guix-build-opencv-3.4.12.drv-0/opencv-3.4.12-checkout/modules/dnn/src/caffe/caffe_io.cpp:1157: error: (-2:Unspecified error) FAILED: ReadProtoFromTextFile(param_file, param). Failed to parse NetParameter file: /tmp/guix-build-opencv-3.4.12.drv-0/opencv-extra/testdata/dnn/layers/accum.prototxt in function 'ReadNetParamsFromTextFileOrDie'
" thrown in the test body.
[ FAILED ] Test_Caffe_layers.Accum/0, where GetParam() = OCV/CPU (1 ms)
I'm building the 3.4.12 release with the following configure options. Also note tha the opencv/3rdparty folder is removed, since the policy for Guix is to package all libraries directly in the distro, so whatever is not yet packaged is disabled (hence the ProtoBuf comment, which is packaged and provided externally).
(list "-DWITH_IPP=OFF"
"-DWITH_ITT=OFF"
"-DWITH_CAROTENE=OFF"
"-DWITH_QUIRC=OFF"
"-DWITH_OPENEXR=OFF"
"-DENABLE_PRECOMPILED_HEADERS=OFF"
"-DCPU_BASELINE=SSE2"
"-DCPU_DISPATCH=NEON;VFPV3;FP16;SSE;SSE2;SSE3;SSSE3;SSE4_1;SSE4_2;POPCNT;AVX;FP16;AVX2;FMA3;AVX_512F;AVX512_SKX"
"-DCPU_DISPATCH_REQUIRE=SSE3,SSSE3,SSE4_1,SSE4_2,AVX,AVX2"
"-DBUILD_PERF_TESTS=OFF"
"-DBUILD_TESTS=ON"
;; opencv-contrib and opencv-extra are cloned in the parent directory
"-DOPENCV_EXTRA_MODULES_PATH=../opencv-contrib/modules"
"-DOPENCV_TEST_DATA_PATH=../opencv-extra/testdata"
;; Is ON by default and would try to rebuild 3rd-party protobuf,
;; which we had removed, which would lead to an error:
"-DBUILD_PROTOBUF=OFF"
;; Rebuild protobuf files, because we have a slightly different
;; version than the included one. If we would not update, we
;; would get a compile error later:
"-DPROTOBUF_UPDATE_FILES=ON"
;; face disabled, because it downloads extra binaries from
;; https://github.com/opencv/opencv_3rdparty defined in
;; modules/face/CMakeLists.txt . If it's really needed, we should
;; patch opencv-contrib/modules/face/CMakeLists.txt so that it
;; gets the necessary binary test data from a native-input we
;; download before the build phase. The same goes for xfeatures2d
;; below.
"-DBUILD_opencv_face=OFF"
;; xfeatures2d disabled, because it downloads extra binaries from
;; https://github.com/opencv/opencv_3rdparty
;; defined in xfeatures2d/cmake/download_{vgg|bootdesc}.cmake
"-DBUILD_opencv_xfeatures2d=OFF")
Here is the full build+test log:
89p9pdv297vawa15l29xl5pf9lfiyi-opencv-3.4.12.txt
My understanding is that since ProtoBuf is found externally, ReadNetParamsFromTextFileOrDie should report the failure of ReadProtoFromTextFile to load the .proto file, then upgrade with UpgradeNetAsNeeded. But apparently it fails and stops at CHECK(ReadProtoFromTextFile(param_file, param)).
Steps to reproduce
I'm not sure this will reproduce on other distributions, as it looks like a basic test failure which would have been caught a long time ago. If you have a Guix system though, reproduce by replacing the opencv package definition in gnu/packages/image-processing.scm with the contents of this file
If you don't have a Guix system, I'm happy to try whatever you tell me to understand this failure! Many thanks either way.
Issue submission checklist
- I report the issue, it's not a question
- I checked the problem with documentation, FAQ, open issues,
answers.opencv.org, Stack Overflow, etc and have not found solution - I updated to latest OpenCV version and the issue is still there (I upgraded to 3.4.12, which is the stable version to be packaged, not the tip of the 3.4 branch)
- There is reproducer code and related data files: videos, images, onnx, etc