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

本站现有博文332篇,共被浏览877920

本站已经建立2584天!

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