How to convert the data formats of the trained model from "NCHW" to "NHWC" with TensorFlow?

Viewed 109

I have my own pytorch, onnx, tf1.x(frozen_graph.pb), and tf2.x(saved_model.pb) models.

Each of those model outputs is exactly same as I expected.

The original model is PyTorch model, but I converted it into the following sequences to run the model on my objective embedded platform:

PyTorch -> onnx -> tf2.x saved_model.pb -> tf1.x frozen_graph.pb

The problem is that. The objective embedded platform only supports data in NHWC format. But my whole models have NCHW format.

So the question is, is there any way to convert the data formats of the trained model from NCHW to NHWC using tf1.x or tf2.x?

Please advice.

0 Answers
Related