Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Benchmark should support NCHW input directly without transpose them twice #267

@ghostplant

Description

@ghostplant

Current benchmark is based on an assumption that input data are always in NHWC format (via tf.image), so when the model is asked to train models in NCHW format, it always firstly transposes the input from NHWC to NCHW.

However, if the input image is of NCHW format directly, we have no other choice but to transpose it into NHWC and then transposed back by the benchmark model, which is bad in performance and memory occupation, and if we let the script to train the input data in NHWC format, the script will no longer transpose the input data, but the model will misunderstand the image format and process the input data in NHWC-based conv2d and maxpooling2d.

So the solution is to handle input data_format carefully to avoid this problem, and I can make a PR to enhance this, is it OK?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions