I have a custom tensorflow model .pb file. I want to import that in OpenCV using the dnn module. dnn module function requires 2 parameters: .pb
file and .pbtxt
file? How can I generate .pbtxt
file from the .pb
file?
cvNet = cv2.dnn.readNetFromTensorflow('FrozenMaster.pb', 'graph.pbtxt')
How to get this graph.pbtxt
file?
The PB file extension is a data file format associated to Corel WordPerfect software. PB files and WordPerfect were developed by Corel Corporation. These files contain search and index information for referencing WordPerfect documents and are used for fast lookups or backups of documents.
pbtxt file that contains text graph definition in protobuf format. Resulting "Net" object is built by text graph using weights from a binary one that let us make it more flexible.
You can open it in any text editor, like Sublime Text or whatever your OS has to offer by default. Save this answer. Show activity on this post.
import cv2
cv2.dnn.writeTextGraph('FrozenMaster.pb', 'graph.pbtxt')
Moreover the following link of opencv github might as well be useful https://github.com/opencv/opencv/wiki/TensorFlow-Object-Detection-API
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With