New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prelu from Tensorflow.keras (assert m.total() == outCn) #17263
Comments
Hi! |
Hi @dkurt |
The current PReLU implementation scales across channels only I think (the functor name is A similar assertion is triggered in the CUDA backend too.
The test has applied PReLU (with 6 parameters) to an input tensor of |
Many Thanks @YashasSamaga |
This is what is happening in your case:
Clearly, the number of channels is not equal to the number of parameters. The fix seems to be non-trivial. I think you'll have to wait for a PR. If you plan on using the CUDA backend, I can make a temporary workaround for you. I just realized that this problem exists in Inference Engine too. |
@YashasSamaga I am using CPU |
https://keras.io/api/layers/activation_layers/prelu/ says
But
However we somehow enabled the test case from #16983 by channel-wise ReLU. Need to check. |
I built latest opencv c++ from source on windows_x64, (this include PR #16983)
I am aware that opencv recently added the support of PRelu from tensorflow. and that is why I built from source.
I am trying a very simple model (that is written in python using tensorflow 1.15):
I freezed this model.
opencv_issue.zip
to call this freezed model from c++:
when net.forward is run. I am getting the following error:
(m.isContinuous() && m.type() == CV_32F && (int)m.total() == outCn) in cv::dnn::ConvolutionLayerImpl::forward, file "opencv-master\modules\dnn\src\layers\convolution_layer.cpp, line 1425
the failure is in the following line:
CV_Assert(m.isContinuous() && m.type() == CV_32F && (int)m.total() == outCn);
m.total() is the width x height = 1 x 12100, while outCn is 1 and that's why it's failing.
I already checked similar issue (13384)
System information (version)
to Freeze the model:
The text was updated successfully, but these errors were encountered: