'How to use my self trained TensorFlow model using cv2.dnn.readNetFromTensorflow()?

I have trained a image classification model using TensorFlow. Now I want to import the trained model into OpenCV to add further functions. I have searched, but the model saved by latest TF gives variable files and a pb file and all the answers available are for earlier version of TF. How can I get a pb and pbtext files as arguments for cv2.dnn.readNetFromTensorflow() or is there a other way to import the model into OpenCV.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source