mirror of
https://github.com/opencv/opencv.git
synced 2025-08-05 22:19:14 +08:00
Added exception when calling forward to specified layer with the new dnn engine
This commit is contained in:
parent
9f0c3f5b2b
commit
3a4c88c33e
@ -1018,8 +1018,8 @@ CV__DNN_INLINE_NS_BEGIN
|
||||
|
||||
enum EngineType
|
||||
{
|
||||
ENGINE_CLASSIC=1, //!< Force use the new dnn engine. The engine does not support non CPU back-ends for now.
|
||||
ENGINE_NEW=2, //!< Force use the old dnn engine similar to 4.x branch
|
||||
ENGINE_CLASSIC=1, //!< Force use the old dnn engine similar to 4.x branch
|
||||
ENGINE_NEW=2, //!< Force use the new dnn engine. The engine does not support non CPU back-ends for now.
|
||||
ENGINE_AUTO=3 //!< Try to use the new engine and then fall back to the classic version.
|
||||
};
|
||||
|
||||
|
@ -1178,6 +1178,9 @@ void Net::Impl::forward(std::vector<std::vector<Mat>>& outputBlobs,
|
||||
CV_Assert(!empty());
|
||||
FPDenormalsIgnoreHintScope fp_denormals_ignore_scope;
|
||||
|
||||
if (mainGraph)
|
||||
CV_Error(Error::StsNotImplemented, "The new dnn engine doesn't support inference until a specified layer. If you want to run the whole model, please don't set the outputName argument in the forward() call. If you want to run the model until a specified layer, please use the old dnn engine");
|
||||
|
||||
std::vector<LayerPin> pins;
|
||||
for (int i = 0; i < outBlobNames.size(); i++)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user