Error from cv2.dnn.readNetFromTensorflow Lambda layer
I am encountering the following error when I try to make the forward pass from my inputted network:
error: OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\dnn\src\dnn.cpp:562: error: (-2:Unspecified error) Can't create layer "lambda_4/truediv" of type "RealDiv" in function 'cv::dnn::dnn4_v20191202::LayerData::getLayerInstance'
I have no issues reading the model, the code I am calling is the following that produces this error: (are Lambda layers a problem?)
import cv2
inputNet=cv2.dnn.readNetFromTensorflow("tf_model.pb")
img=cv2.imread(img_path)
img.shape
tensorflowNet.setInput(cv2.dnn.blobFromImage(img, size=(368, 368), swapRB=True, crop=False))
inputNet.setInput(cv2.dnn.blobFromImage(img, size=(368, 368), swapRB=True, crop=False))
networkOutput=inputNet.forward()
btw, it is a tf.realdiv layer, "lambda" is only the name
is this running on colab ?
added 5 month ago, your 4.2.0 install might not have it. try to update
@berak will do, It is a lambda layer just performing image centering so img/255-.5