Open kkontny opened 1 year ago
@kkontny this might require a lot of effort because of the need to train models ourself. What's available online for torch is largely NCHW as of today - @dkupnicki please estimate the effort needed and we should decide upon that. One suggestion on my side is looking into onnx conversion - we could take nhwc TF models and convert them to torch using ONNX format as intermediary
@jan-grzybek-ampere Here: https://pytorch.org/blog/accelerating-pytorch-vision-models-with-channels-last-on-cpu/ they say you can convert normal model to NHWC with two liner, converting input and model to NHWC format:
# convert input and model to channels last x = x.to(memory_format=torch.channels_last) model = model.to(memory_format=torch.channels_last)
Like I said I'd like this only for Torchvision models where this conversion is available.
Ok, thanks. @MarcelWilnicki can you please look into this?
Since new version Torchvision supports NHWC version of the models, please add the support to model zoo, they can be enabled with some flag like
--nhwc
.Since we don't support it yet in Pytorch-dls, this is lower prio. https://github.com/AmpereComputingAI/pytorch-dls/issues/131