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

相关推荐
RainCity1 天前
Java Swing 自定义组件库分享(十二)
java·笔记·后端
LinXunFeng9 天前
Obsidian - 使用 Share Note 分享笔记并自部署
前端·笔记·github
通信小呆呆13 天前
当算法有了“五感”:多模态数据融合如何向人体感官协同学习?
人工智能·学习·算法·机器学习·机器人
H__Rick13 天前
自动对焦学习-3
人工智能·学习·计算机视觉
Daisy Lee13 天前
量化学习-第1章-什么是量化金融
学习·金融·datawhale
Alsn8613 天前
等待学习-学习目录:Docker 容器安全攻防
学习·安全·docker
YM52e13 天前
买菜计算器小应用 - HarmonyOS ArkUI 开发实战-PC版本
学习·华为·harmonyos·鸿蒙·鸿蒙系统
小雨下雨的雨13 天前
HarmonyOS ArkUI训练营入门-组件掌握系列-Animation 动画效果实现-PC版本
学习·华为·harmonyos·鸿蒙
闪闪发亮的小星星13 天前
高斯光以及高斯光公式解释
笔记
cqbzcsq13 天前
CellFlow虚拟细胞论文阅读
论文阅读·人工智能·笔记·学习·生物信息