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

本站现有博文328篇,共被浏览854835

本站已经建立2562天!

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