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

本站现有博文323篇,共被浏览795417

本站已经建立2493天!

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