当前位置:网站首页>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
边栏推荐
- POJ - 2955 brackets interval DP
- [untitled] database - limit the number of returned rows
- Type conversion in C #
- IO multiplexing of 09 redis
- Plane semi intersecting plate
- Programming record - picture rotation function SciPy ndimage. Simple use and effect observation of rotate()
- Example of reentrant lock thread waiting to wake up
- Three ways to create threads
- SQL -- data filtering and grouping
- Sakura substring thinking
猜你喜欢
Algèbre linéaire chapitre 1 - déterminants
Denoising paper - [noise2void, cvpr19] noise2void learning denoising from single noise images
Paper on LDCT image reconstruction: edge enhancement based transformer for medical image denoising
Fundamentals of in-depth learning -- a simple understanding of meta learning (from Li Hongyi's course notes)
Complete example demonstration of creating table to page - joint table query
Framework analysis 1 Introduction to system architecture
自動控制(韓敏版)
Automatic control (Han min version)
电机与拖动(戚金清版)学习整理
[leetcode 19] delete the penultimate node of the linked list
随机推荐
Linear algebra Chapter 1 - determinant
Contrôle automatique (version Han min)
[leetcode 150] evaluation of inverse Polish expression
IO multiplexing of 09 redis
Advanced operation of idea debug
Mysql database foundation
[leetcode 54] spiral matrix
Optional best practices
Rust 中的 Cell 共享可变指针
[leetcode 6] zigzag transformation
St table template
JDBC connection database
Installation and usage skills of idea
Pytorch notes - complete code for linear regression & manual or automatic calculation of gradient code comparison
MySQL basic madness theory
[leetcode 350] intersection of two arrays II
Exception handling: grab and throw model
3. Continuous integer
9.Life, the Universe, and Everything
5.The Simple Problem