Change the input data layout from NHWC to NCHW to fix the classification bug of ResNet18DefaultBenchmark.
Pytorch is using NCHW to store image input. Since ResNet18DefaultBenchmark is based on 'ResNet-18.mlir' which is converted from a torch model, the input's layout should also be NCHW instead of the default setting NHWC in ImgContainer. After modification the following correct output of ResNet18DefaultBenchmark can be reached:
This change is based on this PR from buddy-mlir.
Change the input data layout from NHWC to NCHW to fix the classification bug of ResNet18DefaultBenchmark.
Pytorch is using NCHW to store image input. Since ResNet18DefaultBenchmark is based on 'ResNet-18.mlir' which is converted from a torch model, the input's layout should also be NCHW instead of the default setting NHWC in ImgContainer. After modification the following correct output of ResNet18DefaultBenchmark can be reached:
For other deep learning benchmarks, data layouts are also explictly given to avoid confusion.