Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

It look like OpenCV do not fully support tensorflow models. I had to retrain model with: https://codelabs.developers.google.com/codelabs/tensorflow-for-poets/

Not with https://www.tensorflow.org/tutorials/image_retraining and tensorflow hub.

Then I had to use optimize_for_inference.py, and then use tensorflow/tools/graph_transforms/transform_graph onUbuntu, becouse compilation of this tool doesn't work on Windows.

bazel run //tensorflow/tools/graph_transforms:transform_graph -- --in_graph=opt_graph.pb --out_graph=final_graph.pb --inputs=input --outputs=final_result --transforms="remove_nodes(op=PlaceholderWithDefault) strip_unused_nodes(type=float, shape=\"1,299,299,3\") sort_by_execution_order"

Now it could be imported, but I have another problem: http://answers.opencv.org/question/190541/netforward-with-tensorflow-problem/

It look like OpenCV do not fully support tensorflow models. I had to retrain model with: https://codelabs.developers.google.com/codelabs/tensorflow-for-poets/

Not with https://www.tensorflow.org/tutorials/image_retraining and tensorflow hub.

Then I had to use optimize_for_inference.py, and then use tensorflow/tools/graph_transforms/transform_graph onUbuntu, becouse compilation of this tool doesn't work on Windows.

bazel run //tensorflow/tools/graph_transforms:transform_graph -- --in_graph=opt_graph.pb --out_graph=final_graph.pb --inputs=input --outputs=final_result --transforms="remove_nodes(op=PlaceholderWithDefault) strip_unused_nodes(type=float, shape=\"1,299,299,3\") sort_by_execution_order"

Now it could be imported, but I have another problem: http://answers.opencv.org/question/190541/netforward-with-tensorflow-problem/

It look like OpenCV do not fully support tensorflow models. I had to retrain model with: https://codelabs.developers.google.com/codelabs/tensorflow-for-poets/

Not with https://www.tensorflow.org/tutorials/image_retraining and tensorflow hub.

Then I had to use optimize_for_inference.py, and then tensorflow/tools/graph_transforms/transform_graph onUbuntu, on Ubuntu, becouse compilation of this tool doesn't work on Windows.

bazel run //tensorflow/tools/graph_transforms:transform_graph -- --in_graph=opt_graph.pb --out_graph=final_graph.pb --inputs=input --outputs=final_result --transforms="remove_nodes(op=PlaceholderWithDefault) strip_unused_nodes(type=float, shape=\"1,299,299,3\") sort_by_execution_order"

Now it could be imported, but I have another problem: http://answers.opencv.org/question/190541/netforward-with-tensorflow-problem/