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

相关推荐
MartinYeung52 分钟前
[论文学习]人工智慧启用系统的隐私增强技术:威胁分析、PETs 应用框架
学习·威胁分析
浩风祭月3 分钟前
Coding-Interview-University 学习路径实测与效能评估
学习
惜年_night5 分钟前
Go语言学习-04结构体/自定义类型/接口
学习
3DVisionary5 分钟前
高温下钢管如何测应变?数字散斑DIC高温压缩测试方案
数码相机·学习·全场应变测量·实验力学·数字散斑dic·高温材料测试·钢管轴向压缩
map1e_zjc6 分钟前
Redis入门笔记(2)
数据库·redis·笔记
我想我不够好。8 分钟前
消防监控学习 6.5 1.5hour
学习
hssfscv9 分钟前
QT的学习记录2
开发语言·qt·学习
@zulnger14 分钟前
WebDriver API及对象识别技术
笔记·python·selenium
世人万千丶29 分钟前
鸿蒙PC问题解决:窗口配置错误修复指南
android·学习·华为·开源·harmonyos·鸿蒙·鸿蒙系统
05候补工程师1 小时前
【期末/408冲刺】软件工程核心考点与大题通关秘籍(附图解与解题套路)
大数据·hadoop·经验分享·笔记·软件工程