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

本站现有博文337篇,共被浏览961416次

本站已经建立2673天!

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