필터 지우기
필터 지우기

Upsampling with bicubic in ONNXNetwork

조회 수: 1 (최근 30일)
Taylor Chu
Taylor Chu 2022년 9월 27일
답변: Sivylla Paraskevopoulou 2022년 9월 29일
I have trained a network with PyTorch with UNet architecture and converted it into ONNX format by torch.onnx.export. Specifically I used 'bicubic' as the mode for nn.Upsample, but when I tried importing the ONNX network to MATLAB I got the error: The value 'cubic' is not supported for the attribute 'mode'. Upon reading about the resize2dLayer, I see that it only supports 'bilinear'. Is there any way to work around so I could use my trained network without modifying the architecture?
Thanks.

답변 (1개)

Sivylla Paraskevopoulou
Sivylla Paraskevopoulou 2022년 9월 29일
Which MATLAB version are you using? Since R2021b, the importONNXNetwork and importONNXLayers functions automatically generate custom layers for ONNX operators that they can't convert to built-in MATLAB layers (in many cases). So that might help you with importing. You can also use importONNXLayers, and import the layer as a placeholder layer, which you have to find and replace with a custom layer to keep the settings you want.
And finally, you can get a pretrained U-Net MATLAB network without having to import. Go to MATLAB Deep Learning Model Hub.

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by