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

本站现有博文327篇,共被浏览833178

本站已经建立2538天!

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