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

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

本站已经建立2631天!

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