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++

相关推荐
一隅论数智4 天前
给AI一张“业务概念地图“:本体如何从哲学走向企业智能
大数据·人工智能·经验分享·笔记·学习·学习方法·政务
XiHongShi20164 天前
STM32F407 RTC定时器例程,建议保存
stm32·单片机·学习
爱吃苹果的日记本4 天前
离散数学第六课
学习·离散数学
AI职业加油站4 天前
AI智能体应用工程师证书:政策红利下的职业新风口
大数据·运维·人工智能·学习·职场发展
深圳老胡4 天前
STM32F407 控制 L6470 步进电机驱动 —— 控制过程简介
笔记·stm32·单片机·嵌入式硬件·代码规范
旖旎夜光4 天前
力控面试题 01.01: 判定字符是否唯一(位运算) —— 题解
c++·学习·算法·leetcode·力控
奇思妙想聪明勤奋的小羊4 天前
DeepAgents第5章:子Agent 与上下文隔离—让 Agent学会委派
人工智能·python·学习·语言模型
Because_of_Her14 天前
并查集-听课笔记
笔记·算法·并查集
霍霍的袁4 天前
【C++】map 和 set 的使用 | 从用法到底层
开发语言·c++·学习·visual studio