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

本站现有博文339篇,共被浏览991711次

本站已经建立2703天!

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