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

本站现有博文321篇,共被浏览764707

本站已经建立2442天!

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