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

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

本站已经建立2583天!

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