benchmarks
benchmarks copied to clipboard
Add option support for native NCHW input data format.
Fixing the issue: https://github.com/tensorflow/benchmarks/issues/267
Note: If not specifying --input_data_format=NCHW manually, all existing logic keeps unchanged.
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 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!