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

本站现有博文333篇,共被浏览905408

本站已经建立2608天!

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