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

本站现有博文312篇,共被浏览745557

本站已经建立2391天!

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