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

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

Open
ghostplant opened this issue Nov 10, 2018 · 0 comments

Comments

@ghostplant
Copy link

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?

@ghostplant ghostplant changed the title Benchmark should support NCHW input without NCHW training transpose twice Benchmark should support NCHW input directly without transpose them twice Nov 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant