이론 관련/컴퓨터 관련
NCHW, NHWC
구차니
2026. 5. 6. 14:54
N - Number of image size in batch size
H - Height of image
W - Width of image
C- number of Channel of the image
NCHW는 Channel First (red channel image + blue ...)
NHWC는 Channel Last (rgb pixel image)

[링크 : https://intel.github.io/intel-extension-for-pytorch/cpu/latest/tutorials/features/nhwc.html]
어떻게 보면 레이어 별로 처리하게 하는게 유리할수도 있을 것 같기도 한데 서로 tradeoff가 존재할 것 같다.
NCHW - (64,3,512,512)
NHWC - (64,512,512,3)
[링크 : https://medium.com/@gonchogo/nhwc-vs-nchw-1504d2621b5e]
GPU - NCHW
CPU - NHWC
tensorRT는 NHWC에서 최고의 효율