- output layout is CHW, using perf_analyzer to profile.
@autoserialize
@dali.pipeline_def(batch_size=3, num_threads=1, device_id=0)
def pipe():
images = dali.fn.external_source(device="cpu", name="encoded")
images = dali.fn.decoders.image(images, device="mixed", output_type=types.RGB)
images = dali.fn.resize(images, resize_x=299, resize_y=299)
images = dali.fn.crop_mirror_normalize(images,
dtype=types.FLOAT,
output_layout="CHW",
crop=(299, 299),
mean=[0.485 * 255, 0.456 * 255, 0.406 * 255],
std=[0.229 * 255, 0.224 * 255, 0.225 * 255])
return images

- output layout is HWC
@autoserialize
@dali.pipeline_def(batch_size=3, num_threads=1, device_id=0)
def pipe():
images = dali.fn.external_source(device="cpu", name="encoded")
images = dali.fn.decoders.image(images, device="mixed", output_type=types.RGB)
images = dali.fn.resize(images, resize_x=299, resize_y=299)
images = dali.fn.crop_mirror_normalize(images,
dtype=types.FLOAT,
output_layout="HWC",
crop=(299, 299),
mean=[0.485 * 255, 0.456 * 255, 0.406 * 255],
std=[0.229 * 255, 0.224 * 255, 0.225 * 255])
return images

Most of time, model input layout is "NCHW", is there any way we can improve performance?
Most of time, model input layout is "NCHW", is there any way we can improve performance?