Upsampling with bicubic in ONNXNetwork
조회 수: 2 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
답변 (1개)
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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Data Workflows에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!