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
标签云
SQLite 关于博主 torchinfo Windows CLAP Cloudreve Google 递归学习法 飞书 CSV Breakpoint transformers Data 图标 Jetson mmap WebCrawler TTS Website Pytorch 云服务器 Land Excel HuggingFace Input Permission PyCharm Django Pandas Zip Statistics LLM CUDA Miniforge DeepSeek COCO Quantization Transformers diffusers LoRA Password 签证 NLP 公式 FlashAttention Ptyhon Video UI CC YOLO Bin Qwen2.5 Random FP16 GIT Domain Gemma scipy hf Datetime tqdm Pickle Claude VSCode CAM Heatmap Tiktoken MD5 git-lfs LaTeX 算法题 Magnet Ubuntu 搞笑 BF16 EXCEL TSV v0.dev Image2Text v2ray RGB Qwen Nginx ChatGPT 版权 C++ InvalidArgumentError Jupyter Freesound CEIR QWEN Mixtral Logo tar LLAMA Attention Augmentation CTC AI Python Use FP8 Template Safetensors 多线程 icon Tracking SQL TensorRT Animate Firewall Vmess Review OpenCV GPTQ Pillow OpenAI Distillation Conda RAR VPN LeetCode git Dataset 报税 Docker Bert Plotly Disk Plate Tensor Baidu 顶会 WAN Qwen2 IndexTTS2 SPIE Crawler FP32 NameSilo 净利润 PIP Algorithm Numpy Vim News VGG-16 Card 证件照 ModelScope SAM logger Diagram TensorFlow Agent 强化学习 Hotel llama.cpp PDF Clash 第一性原理 BTC uWSGI JSON GoogLeNet Git ResNet-50 FP64 Sklearn 图形思考法 OCR SVR DeepStream Markdown Paddle Bipartite Quantize XML CV Knowledge GPT4 Anaconda Linux Shortcut 多进程 Llama Translation Food 域名 Github 腾讯云 Hilton 阿里云 XGBoost BeautifulSoup printf PyTorch ONNX 财报 Math uwsgi Paper Proxy Interview HaggingFace Web NLTK UNIX Hungarian Streamlit 继承 Base64 PDB Bitcoin Michelin 音频 Color FastAPI Search API GGML
站点统计

本站现有博文322篇,共被浏览786954

本站已经建立2481天!

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