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

本站现有博文333篇,共被浏览923972

本站已经建立2630天!

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