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

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

本站已经建立2533天!

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