You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A lot of APIs that are currently being used in the dnn module have been removed in cudnn 9. They were deprecated in 8. This PR updates said code accordingly to the newer API.
Some key notes:
This is my first PR. I am new to openCV.
opencv_test_core tests pass
On a 3080, cuda 12.4(should be irrelevant since I didn't build the opencv_modules, gcc 11.4, WSL 2.
For brevity I will avoid including macro code that will allow for older versions of cudnn to build.
I was unable to get the tests working for opencv_test_dnn and opencv_perf_dnn. The errors I get are of the following:
OpenCV tests: Can't find required data file: dnn/onnx/conformance/node/test_reduce_prod_default_axes_keepdims_example/model.onnx in function 'findData'
" thrown in the test body.
So before I spend more time investigating I was hoping to get a maintainer to point me in the right direction here. I would like to run these tests and confirm things are working as intended. I may have missed some details.
Please do not touch original formatting and the code that is not relevant to CuDNN 9.0.
OpenCV uses opencv_extra repository to store test data. See https://github.com/opencv/opencv/wiki/QA_in_OpenCV. Also there is download_models.py script in opencv_extra/testdata/dnn to download 3rdparty models for testing. Please use it to achieve full dnn coverage locally.
[ 72%] Building CXX object modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/const_layer.cpp.o
In file included from /home/alexander/Projects/OpenCV/opencv-master/modules/dnn/src/layers/../cuda4dnn/csl/cudnn.hpp:8:0,
from /home/alexander/Projects/OpenCV/opencv-master/modules/dnn/src/layers/../op_cuda.hpp:12,
from /home/alexander/Projects/OpenCV/opencv-master/modules/dnn/src/layers/blank_layer.cpp:43:
/home/alexander/Projects/OpenCV/opencv-master/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/cudnn/recurrent.hpp: In constructor ‘cv::dnn::cuda4dnn::csl::cudnn::RNNDescriptor<T>::RNNDescriptor(const cv::dnn::cuda4dnn::csl::cudnn::Handle&, cv::dnn::cuda4dnn::csl::cudnn::RNNDescriptor<T>::RNNMode, int, int, bool, const cv::dnn::cuda4dnn::csl::cudnn::DropoutDescriptor&)’:
/home/alexander/Projects/OpenCV/opencv-master/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/cudnn/recurrent.hpp:129:11: error: ‘input_size’ was not declared in this scope
input_size, hidden_size,
^
/home/alexander/Projects/OpenCV/opencv-master/modules/dnn/src/layers/../cuda4dnn/csl/cudnn/cudnn.hpp:22:53: note: in definition of macro ‘CUDA4DNN_CHECK_CUDNN’
::cv::dnn::cuda4dnn::csl::cudnn::detail::check((call), CV_Func, __FILE__, __LINE__)
^~~~
/home/alexander/Projects/OpenCV/opencv-master/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/cudnn/recurrent.hpp:129:11: note: suggested alternative: ‘hidden_size’
input_size, hidden_size,
^
/home/alexander/Projects/OpenCV/opencv-master/modules/dnn/src/layers/../cuda4dnn/csl/cudnn/cudnn.hpp:22:53: note: in definition of macro ‘CUDA4DNN_CHECK_CUDNN’
::cv::dnn::cuda4dnn::csl::cudnn::detail::check((call), CV_Func, __FILE__, __LINE__)
^~~~
In file included from /home/alexander/Projects/OpenCV/opencv-master/modules/dnn/src/layers/../cuda4dnn/primitives/reshape.hpp:12:0,
from /home/alexander/Projects/OpenCV/opencv-master/modules/dnn/src/layers/blank_layer.cpp:49:
/home/alexander/Projects/OpenCV/opencv-master/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/tensor_ops.hpp: In constructor ‘cv::dnn::cuda4dnn::csl::LSTM<T>::LSTM(cv::dnn::cuda4dnn::csl::cudnn::Handle, const cv::dnn::cuda4dnn::csl::LSTM<T>::params_type&)’:
/home/alexander/Projects/OpenCV/opencv-master/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/tensor_ops.hpp:548:13: error: ‘filterDesc’ was not declared in this scope
filterDesc = FilterDescriptor(params.weights_shape);
^~~~~~~~~~
modules/dnn/CMakeFiles/opencv_dnn.dir/build.make:853: recipe for target 'modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/blank_layer.cpp.o' failed
make[3]: *** [modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/blank_layer.cpp.o] Error 1
make[3]: *** Ожидание завершения заданий…
In file included from /home/alexander/Projects/OpenCV/opencv-master/modules/dnn/src/layers/../cuda4dnn/csl/cudnn.hpp:8:0,
from /home/alexander/Projects/OpenCV/opencv-master/modules/dnn/src/layers/../op_cuda.hpp:12,
from /home/alexander/Projects/OpenCV/opencv-master/modules/dnn/src/layers/const_layer.cpp:10:
/home/alexander/Projects/OpenCV/opencv-master/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/cudnn/recurrent.hpp: In constructor ‘cv::dnn::cuda4dnn::csl::cudnn::RNNDescriptor<T>::RNNDescriptor(const cv::dnn::cuda4dnn::csl::cudnn::Handle&, cv::dnn::cuda4dnn::csl::cudnn::RNNDescriptor<T>::RNNMode, int, int, bool, const cv::dnn::cuda4dnn::csl::cudnn::DropoutDescriptor&)’:
/home/alexander/Projects/OpenCV/opencv-master/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/cudnn/recurrent.hpp:129:11: error: ‘input_size’ was not declared in this scope
input_size, hidden_size,
^
/home/alexander/Projects/OpenCV/opencv-master/modules/dnn/src/layers/../cuda4dnn/csl/cudnn/cudnn.hpp:22:53: note: in definition of macro ‘CUDA4DNN_CHECK_CUDNN’
::cv::dnn::cuda4dnn::csl::cudnn::detail::check((call), CV_Func, __FILE__, __LINE__)
^~~~
/home/alexander/Projects/OpenCV/opencv-master/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/cudnn/recurrent.hpp:129:11: note: suggested alternative: ‘hidden_size’
input_size, hidden_size,
^
/home/alexander/Projects/OpenCV/opencv-master/modules/dnn/src/layers/../cuda4dnn/csl/cudnn/cudnn.hpp:22:53: note: in definition of macro ‘CUDA4DNN_CHECK_CUDNN’
::cv::dnn::cuda4dnn::csl::cudnn::detail::check((call), CV_Func, __FILE__, __LINE__)
^~~~
In file included from /home/alexander/Projects/OpenCV/opencv-master/modules/dnn/src/layers/../cuda4dnn/primitives/const.hpp:12:0,
from /home/alexander/Projects/OpenCV/opencv-master/modules/dnn/src/layers/const_layer.cpp:23:
/home/alexander/Projects/OpenCV/opencv-master/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/tensor_ops.hpp: In constructor ‘cv::dnn::cuda4dnn::csl::LSTM<T>::LSTM(cv::dnn::cuda4dnn::csl::cudnn::Handle, const cv::dnn::cuda4dnn::csl::LSTM<T>::params_type&)’:
/home/alexander/Projects/OpenCV/opencv-master/modules/dnn/src/layers/../cuda4dnn/primitives/../csl/tensor_ops.hpp:548:13: error: ‘filterDesc’ was not declared in this scope
filterDesc = FilterDescriptor(params.weights_shape);
^~~~~~~~~~
modules/dnn/CMakeFiles/opencv_dnn.dir/build.make:881: recipe for target 'modules/dnn/CMakeFiles/opencv_dnn.dir/src/layers/const_layer.cpp.o' failed
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A lot of APIs that are currently being used in the dnn module have been removed in cudnn 9. They were deprecated in 8. This PR updates said code accordingly to the newer API.
Some key notes:
opencv_test_core
tests passopencv_modules
, gcc 11.4, WSL 2.I was unable to get the tests working for
opencv_test_dnn
andopencv_perf_dnn
. The errors I get are of the following:So before I spend more time investigating I was hoping to get a maintainer to point me in the right direction here. I would like to run these tests and confirm things are working as intended. I may have missed some details.
Pull Request Readiness Checklist
relevant issue
(#24983
Patch to opencv_extra has the same branch name.