EADST

Pytorch: Freeze layers to Finetune the Model

Pytorch: Freeze layers to Finetune the Model.

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

本站现有博文323篇,共被浏览795246

本站已经建立2493天!

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