当前位置:网站首页>The onnx model of yolov5 removes the transfer layer
The onnx model of yolov5 removes the transfer layer
2022-04-23 06:33:00 【ZhangLH66】
import onnx
from onnx import helper, checker
from onnx import TensorProto
import re
import argparse
model = ""
onnx_model = onnx.load(model)
graph = onnx_model.graph
# print(graph)
node = graph.node
# node[213].output[0] = node[212].output[0]
# node[213].output[0] = node[213].input[0]
# for idx in graph.node:
# print(idx)
# graph.node[]
graph.node.remove(graph.node[215])
#
graph.node.remove(graph.node[214])
graph.node.remove(graph.node[213])
# node[212].name = 'output'
for i in range(len(node)):
# print(node[i])
if node[i].name == 'Conv_212':
node[i].output[0]="output"
if node[i].name == 'Conv_193':
node[i].output[0]="390"
if node[i].name == 'Conv_174':
node[i].output[0]="391"
onnx.checker.check_model(onnx_model)
onnx.save(onnx_model,"best_del_transpose.onnx")
版权声明
本文为[ZhangLH66]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210614497652.html
边栏推荐
- JDBC tool class encapsulation
- List segmentation best practices
- 檢測技術與原理
- Event listener
- IO multiplexing of 09 redis
- Kalman filter and inertial integrated navigation
- 2. Devops sonar installation
- 9.Life, the Universe, and Everything
- Implementation of displaying database pictures to browser tables based on thymeleaf
- LockSupport. Park and unpark, wait and notify
猜你喜欢

Substring Inversion (Easy Version)

Kibana search syntax
![Reading of denoising papers - [cvpr2022] blind2blind: self supervised image denoising with visible blind spots](/img/fd/84df62c88fe90a73294886642036a0.png)
Reading of denoising papers - [cvpr2022] blind2blind: self supervised image denoising with visible blind spots
![[leetcode 59] spiral matrix II](/img/6e/58e600272797563129d2b325a054b5.png)
[leetcode 59] spiral matrix II

檢測技術與原理

The bottom implementation principle of thread - static agent mode

Type conversion in C #

Import of data

Linear algebra Chapter 1 - determinant

Explanation of login page
随机推荐
Pytorch notes - get familiar with the network construction method by building RESNET (complete code)
[leetcode 401] binary Watch
POJ - 2955 brackets interval DP
Implementation of displaying database pictures to browser tables based on thymeleaf
从源代码到可执行文件的过程
10.Advance Next Round
Linear algebra Chapter 1 - determinant
Comparative study paper - [Moco, cvpr2020] momentum contract for unsupervised visual representation learning
Algèbre linéaire chapitre 1 - déterminants
8. Integer Decomposition
[leetcode 59] spiral matrix II
Chapter 4 of line generation - linear correlation of vector systems
检测技术与原理
[untitled] database - limit the number of returned rows
Export of data
Three ways to create threads
Supply chain service terms
Practical operation - Nacos installation and configuration
RPC must know and know
Failure to deliver XID in Seata distributed transaction project