Pytorch使用集成可形变卷积构建网络并导出onnx模型
解决RuntimeError: Exporting the operator deform_conv2d to ONNX opset version 14 is not supported. Please feel free to request support or submit a pull request on PyTorch GitHub问题
一、安装对应的包
pip install deform_conv2d_onnx_exporter
二、构建简易网络模型
import torch
import torchvision.ops
from torch import nn
import deform_conv2d_onnx_exporter
deform_conv2d_onnx_exporter.register_deform_conv2d_onnx_op()
class mynet(nn.Module):
def __init__(self):
super(mynet,self).__init__()
self.weight = torch.rand(5, 3, 3, 3) # (out_channels, in_c
原文地址:https://blog.csdn.net/baidu_28342107/article/details/142368813
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!