Upsampling with bicubic in ONNXNetwork
4 次查看(过去 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!