Published August 1, 2026 | Version 2.6.8

Tools to convert ONNX files (NCHW) to TensorFlow format (NHWC)

Authors/Creators

Description

2.6.8

Issue

Conv.make_node() reads input_tensor_shape before the workaround that transposes an NCHW input to NHWC, and never refreshes it.

The depthwise test compares group against input_tensor_shape[-1]. For a transposed input this compares the channel count against a spatial dimension, the test fails, and the node falls through to the grouped-conv path — producing a filter of shape [C, K, K, 1] instead of a DepthwiseConv2D.

Symptom: in a MobileNet/ConvNeXt-style network only the first depthwise conv of each stage converts correctly (it consumes a conv output directly), while the following ones are silently degraded (they consume a residual Add whose input required the transpose).

The ONNX model is valid — depthwise is Conv with group=C and weight [C, 1, K, K].

Fix

Refresh input_tensor_shape from input_tensor right before the depthwise test.

What's Changed

  • Fix depthwise Conv detection after NCHW->NHWC input transpose (Legacy converter) by @AL3708 in https://github.com/PINTO0309/onnx2tf/pull/959

Full Changelog: https://github.com/PINTO0309/onnx2tf/compare/2.6.7...2.6.8

Notes

If you use onnx2tf in your research, please cite it using these metadata.

Files

PINTO0309/onnx2tf-2.6.8.zip

Files (6.7 MB)

Name Size Download all
md5:46d6bfe0272535012d96fd0d622ad1a5
6.7 MB Preview Download

Additional details

Related works

Is supplement to
Software: https://github.com/PINTO0309/onnx2tf/tree/2.6.8 (URL)

Software