Unable to import tensorflow object detection model in opencv dnn ?
Hi everyone, I had trained tensorflow object detection model with my own dataset and I had obtained the .pb and .prototxt files after training. When I tried to load the model and prototxt file in this opencv dnn sample code, I am always getting an error saying that cv.dnn.readNetFromTensorflow() accepts only 1 argument but 2 arguments given. But in the sample code 2 arguments are given. I new to opencv and dnn and don't know how to load the .pb tensorflow file into the opencv dnn code. Should I make any modifications ? Please help me . Thanks :)
@ManojGuha, first of all you need to update OpenCV to the latest state from the master branch. Then check that
import cv2
imports it from the correct place (checkprint(cv2.__file__)
). Also it'd be better to know the kind of model (sample is used for MobileNet-SSD architecture), configuration file you used to define a model (like a https://github.com/tensorflow/models/...).I think that in 3.3.0 the function only takes one argument which is the path to the .pb file.
@jingyibo123, no, there were recent changes, see here