benchmarks icon indicating copy to clipboard operation
benchmarks copied to clipboard

Add option support for native NCHW input data format.

Open ghostplant opened this issue 7 years ago • 2 comments

Fixing the issue: https://github.com/tensorflow/benchmarks/issues/267

Note: If not specifying --input_data_format=NCHW manually, all existing logic keeps unchanged.

ghostplant avatar Nov 10 '18 04:11 ghostplant

Can you clarify what this PR does? With --input_data_format, you move the transpose logic to another part of the code, but you still do the transpose.

reedwm avatar Nov 16 '18 01:11 reedwm

@reedwm Hi, it is a good question. Because it is possible to generate the input in NCHW format directly such as dataset.from_tensor/from_generator and other kind of pre-processed data, which would be faster during training and inference in terms of performance and it also costs less GPU memory and also CPU memory since we no longer need a useless format conversion. For this commit, it allows the model to accept NCHW input format without twice time of format conversion on GPU(or CPU), and in the future I could add the case of feeding NCHW input data for this case once it is accepted. Thanks!

ghostplant avatar Nov 17 '18 04:11 ghostplant