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

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

本站已经建立2628天!

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