0325学习笔记

复现cvt2distilgpt2过程

一、切换目录并clone代码:cd /lishnai28/lcs/lcs/

git clone https://github.com/aehrc/cvt2distilgpt2.git

cd cvt2distilgpt2

二、创建虚拟环境并激活:

conda create -n cvt2 python=3.8 -y

conda activate cvt2

三、具体操作:

1,更新pip包管理器:pip install --upgrade pip

(虚拟环境中python -m pip install --upgrade pip和pip install --upgrade pip的行为一致。若当前存在多个python版本和虚拟环境,使用python -m 可以显式指定使用当前激活的python解释器,更安全)

2,安装依赖:pip install --upgrade -r requirements.txt --no-cache-dir

3,权重文件准备

两个模型检查点下载并上传(下载地址------https://doi.org/10.25919/ng3g-aj81)

chexbert.pth从源目录复制:cp /lishnai28/lcs/lcs/CheXbert/src/chexbert.pth /lishnai28/lcs/lcs/cvt2distilgpt2/checkpoints/stanford/chexbert/

4,数据集选择直接切换目录不再重复粘贴

mimic-cxr-jpg:/lishnai28/lcs/lcs/mimic_cxr/images/

mimic-cxr标签(对应的annotations.json):/lishnai28/lcs/lcs/mimic_cxr/annotation.json

iu_xray images:/lishnai28/lcs/lcs/iu_xray/images/

iu_xray annotations:/lishnai28/lcs/lcs/iu_xray/annotation.json

5,运行测试

dlhpcstarter -t iu_x_ray_chen -c config/test_iu_x_ray_chen_cvt2distilgpt2.yaml --stages_module stages --test

dlhpcstarter -t mimic_cxr_chen -c config/test_mimic_cxr_chen_cvt2distilgpt2.yaml --stages_module stages --test

解决报错:

1,下载CvT-21 检查点"/lishnai28/lcs/lcs/cvt2distilgpt2/checkpoints/microsoft/CvT/CvT-21-384x384-IN-22k.pth"(https://github.com/microsoft/CvT)

DistilGPT2 检查点"/lishnai28/lcs/lcs/cvt2distilgpt2/checkpoints/distilgpt2/"(https://huggingface.co/distilbert/distilgpt2)

测试指标复现成功√、下边是对应修改后的代码文件

6,模型训练

dlhpcstarter -t iu_x_ray_chen -c config/train_iu_x_ray_chen_cvt2distilgpt2.yaml --stages_module stages --train --test

dlhpcstarter -t mimic_cxr -c config/train_mimic_cxr_chen_cvt2distilgpt2.yaml --stages_module stages --train --test

git-lfs在Linux 下正确的安装与初始化命令(pip不管用):

++# 1. 安装 git-lfs
conda install -c conda-forge git-lfs++

++# 2. 初始化 git-lfs (这会在你的 ~/.gitconfig 中写入必要的全局配置)
git lfs install++

相关推荐
Rabitebla8 小时前
【Linux 底层原理】进程(十):进程等待详解---从僵尸进程到 wait、waitpid 与 status
linux·c++·笔记·学习·visual studio
小lu飞9 小时前
2026小红书小工具怎么制作:纯前端 ZIP 打包、沙箱限制与笔记挂载流程
前端·笔记·ai·ai编程
无心水13 小时前
24、系统架构师论文写作专题 核心考点与学习笔记
笔记·学习·系统架构·架构师·安全架构·软考架构师·软考系统架构设计师
蒸蒸yyyyzwd13 小时前
邓明 Agent 系统面试-意图识别学习笔记
笔记·学习
Zhao-Jichao16 小时前
AI Prompting for Everyone 课程笔记 - P21 总结 Conclusion
人工智能·笔记
欢欢李16 小时前
【LTE L3 笔记 05】LTE同步信号
笔记·无线通信·物理层·lte·空口协议
La Pulga18 小时前
【FreeRTOS源码学习笔记】空闲任务与阻塞延时
笔记·mcu·学习·嵌入式·freertos·实时操作系统
蒸蒸yyyyzwd18 小时前
秋招学习笔记 day106
笔记·学习
小李不想当小白19 小时前
WDG看门狗(STM32标准库学习笔记)
笔记·stm32·单片机·嵌入式硬件·学习·嵌入式
欢欢李20 小时前
【LTE L3 笔记 04】LTE帧结构
笔记·无线通信·物理层·lte·空口协议