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

本站现有博文338篇,共被浏览970764次

本站已经建立2682天!

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