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

本站现有博文324篇,共被浏览808941

本站已经建立2511天!

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