当前位置:网站首页>pth 转 onnx 时出现的 gather、unsqueeze 等算子
pth 转 onnx 时出现的 gather、unsqueeze 等算子
2022-04-23 06:12:00 【wujpbb7】
带动态输入的 view 或者 reshape 转成 onnx 会有shape/gather/unsqueeze/concat算子。
替换成 flatten 即可。
def forward(self, inputs):
x1 = self.conv1(inputs)
x2 = self.conv2(x1)
# 带动态输入的 view 或者 reshape 转成 onnx 会有shape/gather/unsqueeze/concat算子。
#x2_flatten = x2.view(x2.size(0), -1)
#x2_flatten = torch.reshape(x2, (x2.size(0), -1))
x2_flatten = torch.flatten(x2, start_dim=1)
x3 = self.fc1(x2_flatten)
x4 = self.fc2(x3)
return x4
版权声明
本文为[wujpbb7]所创,转载请带上原文链接,感谢
https://blog.csdn.net/blueblood7/article/details/120292177
边栏推荐
猜你喜欢
Visual Studio 2019安装与使用
Visual studio 2019 installation and use
[2021 book recommendation] kubernetes in production best practices
【点云系列】SO-Net:Self-Organizing Network for Point Cloud Analysis
Paddleocr image text extraction
给女朋友写个微信双开小工具
[3D shape reconstruction series] implicit functions in feature space for 3D shape reconstruction and completion
第4章 Pytorch数据处理工具箱
PaddleOCR 图片文字提取
Gee configuring local development environment
随机推荐
PyTorch 9. 优化器
How keras saves and loads the keras model
1.2 初试PyTorch神经网络
机器学习 二:基于鸢尾花(iris)数据集的逻辑回归分类
【点云系列】点云隐式表达相关论文概要
How to standardize multidimensional matrix (based on numpy)
Minesweeping games
Machine learning III: classification prediction based on logistic regression
[2021 book recommendation] kubernetes in production best practices
What did you do during the internship
Pytorch模型保存与加载(示例)
第5 章 机器学习基础
Gobang games
PyTorch 11.正则化
[point cloud series] sg-gan: advantageous self attention GCN for point cloud topological parts generation
Chapter 4 pytoch data processing toolbox
机器学习——模型优化
Gee configuring local development environment
最简单完整的libwebsockets的例子
Chapter 8 generative deep learning