AttributeError: 'dnn' object has no attribute 'writeTextGraph'
Hello, Im trying to load a pretrained Tensorflow model using OpenCV by following the steps in the below link: https://github.com/opencv/opencv/wiki... When i try to generate a text representation of the graph by using the script tf_text_graph_ssd.py ,Im getting the error AttributeError: 'dnn' object has no attribute 'writeTextGraph' . I have the OpenCv 3.4 installed on my machine and I checked that dnn doesnt have an attribute or method under that name by running dir(dnn) in python after importing the library . When I chekced the online documentation ,I could find it exists : https://docs.opencv.org/trunk/d6/d0f/... but not in opencv python . I dont know what I am missing here .How can I fix the error ?
Thanks Ayad
cv2.__version__ ? how did you install it ?
hmm, last attempt at python bindings here 2018:07:05 -- does not have it, either.
would you be able to rebuild it from the current 3.4 branch ? it seems, that it was added 14 days ago.
Or use
tf_text_graph_ssd.py
from the same version of OpenCV. Keep things synced.@dkurt, it says in the wiki, that 3.4.1 can be used. clearly not so for
cv.dnn.writeTextGraph()
@dkurt ,thanks.I installed opencv using pip .Im new to opencv so not really sure how to build it from source .So what do you suggest ?
I have the same issue. I tried "pip install" and also compiled the opencv 3.4.3 source codes by myself. Both have the same error "module 'cv2.dnn' has no attribute 'writeTextGraph".
@berak, you're right. We've prepared a PR with tensorflow fallback in case of outdated OpenCV: https://github.com/opencv/opencv/pull....