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

本站现有博文320篇,共被浏览757299

本站已经建立2422天!

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