EADST

Update the Weights in the ONNX Model

Update the Weights in the ONNX Model

import onnx

onnx_path = "test.onnx"
onnx_model = onnx.load(onnx_path)
graph = onnx_model.graph
node  = graph.node
for i in range(len(node)):
    # get the node and check the node type
    if node[i].op_type == 'Constant':
        att = node[i].attribute[0]
        # based on the node structure and data type to find the target
        # It is better to print the structure, and then load it step by step.
        if att and att.t and att.t.float_data:
            temp = att.t.float_data[0]
            node[i].attribute[0].t.float_data[0] = temp + 0.5
onnx.save(onnx_model, 'new_onnx.onnx')
相关标签
About Me
XD
Goals determine what you are going to be.
Category
标签云
Disk XGBoost Plotly 关于博主 icon git InvalidArgumentError RL Google uWSGI Qwen2.5 Django Bitcoin Llama FlashAttention FP64 CSV Password Web PyTorch Interview Transformers 顶会 Bin ONNX Video v2ray Search Breakpoint Image2Text TTS Numpy SAM SQL tar 版权 GPT4 Food Quantization Mixtral Rebuttal Streamlit Harness scipy Augmentation Base64 tqdm Zip uwsgi NLP Distillation SPIE Pytorch VGG-16 Github COCO UNIX 音频 论文 CC Card FastAPI v0.dev QWEN llama.cpp Pickle Math TensorFlow Template torchinfo Claude Animate 论文速读 财报 LeetCode API HaggingFace Paper MD5 RGB Use Logo Windows Website 继承 SVR GPTQ NameSilo Attention Diagram Agent Proxy CV Docker CEIR Domain Firewall Bipartite Heatmap Input 算法题 Shortcut WebCrawler Clash TensorRT LLM printf PyCharm 云服务器 Hungarian EXCEL PDF 强化学习 TSV logger transformers BeautifulSoup 证件照 DeepSeek DeepStream API网关 YOLO Sklearn IndexTTS2 ChatGPT HuggingFace OCR Data SQLite LoRA GGML 腾讯云 Baidu Markdown Tiktoken UI ResNet-50 Cloudreve 图标 Gemma Plate 多线程 VSCode Ptyhon RAR C++ Pillow WAN Dataset Hilton Qwen2 PIP Vmess Tensor Permission Qwen VPN Bert Anaconda 搞笑 CLAP Review CUDA 多进程 ms-swift CTC CAM 域名 Jupyter Color BTC Safetensors Tracking XML LLAMA Algorithm OpenCV Excel 阿里云 ModelScope 报税 JSON Random Magnet diffusers GIT Jetson Paddle Freesound Vim LaTeX 第一性原理 PDB BF16 Conda Statistics Ubuntu FP16 飞书 签证 Quantize Translation Datetime git-lfs Python News Linux Pandas AI Hotel Nginx Git FP8 hf Crawler FP32 图形思考法 mmap Land 公式 Michelin OpenAI GoogLeNet 净利润 Miniforge 递归学习法 Knowledge NLTK
站点统计

本站现有博文336篇,共被浏览943427

本站已经建立2653天!

热门文章
文章归档
回到顶部