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

本站现有博文311篇,共被浏览740036

本站已经建立2376天!

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