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

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

本站已经建立2493天!

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