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!