We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1b83bc4 commit a9ebc61Copy full SHA for a9ebc61
modules/dnn/src/dnn.cpp
@@ -53,6 +53,7 @@
53
#include <opencv2/imgproc.hpp>
54
55
#include <opencv2/core/utils/configuration.private.hpp>
56
+#include <opencv2/core/utils/logger.hpp>
57
58
namespace cv {
59
namespace dnn {
@@ -846,6 +847,13 @@ struct Net::Impl
846
847
848
if (!netWasAllocated || this->blobsToKeep != blobsToKeep_)
849
{
850
+#ifndef HAVE_OPENCL
851
+ if (preferableBackend == DNN_BACKEND_DEFAULT && preferableTarget == DNN_TARGET_OPENCL)
852
+ {
853
+ CV_LOG_WARNING(NULL, "DNN: OpenCL target is not available in this OpenCV build, switching to CPU.")
854
+ preferableTarget = DNN_TARGET_CPU;
855
+ }
856
+#endif
857
clear();
858
859
allocateLayers(blobsToKeep_);
0 commit comments