当前位置: 首页 > news >正文

复现论文:DPStyler: Dynamic PromptStyler for Source-Free Domain Generalization

论文:[2403.16697] DPStyler: Dynamic PromptStyler for Source-Free Domain Generalization

github: 

TYLfromSEU/DPStyler: DPStyler: Dynamic PromptStyler for Source-Free Domain Generalization

论文:

这篇论文还是在PromptStyler:Prompt-driven Style Generation for Source-free Domain Generalization基础上对一些架构进行修改的。

Contribution

Style Generation Module:

dynamically refresh style by regenerating all style word vectors including Random and StyleMix between epochs.(randomly select one method)

Style Removal Module:

propose a domain uncertainty loss after encoder, to reduce specific style information and learn domain-invariant features

Model Ensemble:inference stage

for each text template, train a model and each model is involved in the inference process

Because introducing more randomness into the training process

大致代码流程

 

复现结果

PACS

VLCS

OfficeHome

DomainNet

avg

ResNet-50

92.1__-1.5

81.4__-2.1

70.5__-2.0

45.5__-2.5

72.4__-2.0

ViT-B/16

96.6__-0.5

80.8__-3.2

56.9__-2.0

PACS:

Art Painting

Cartoon

Photo

Sketch

avg

ResNet-50

92.7__-1.3

96.4__+1.1

99.6__0

79.6__-5.9

92.1__-1.5

ViT-B/16

97.6__-0.1

99.2__+0.3

99.9__0

89.8__-2.1

96.6__-0.5

ResNet-50:

92.4 96.5 99.6 78.4

93.4 96.2 99.5 81.7

92.2 96.5 99.6 78.6

ViT-B/16:

97.6 99.3 99.9 89.0

97.6 99.1 99.9 90.8

97.6 99.2 99.9 89.6

VLCS:

VLCS

Caletch

LableMe

SUN09

VOC2007

avg

ResNet-50

100__0

65.0__-8.3

73.9__+2.1

86.5__-2.5

81.4__-2.1

ViT-B/16

100__0

59.7__-9.4

80.4__+4.1

82.9__-7.6

80.8__-3.2

ResNet-50:

100 67.9 87.2 74.2 82.325

100 62.2 85.7 73.0 80.225

100 64.4 86.7 74.4 81.375

81.304

ViT-B/16:

100 62.4 88.5 77.6 82.125

100 61.1 83.1 75.5 79.925

100 55.7 77 88 80.175

80.7417

Office-Home:

Office-Home

Art

Clipart

Product

Real World

avg

ResNet-50

72.3__-1.3

49.1__-2.1

78.8__-3.3

81.6__-1.3

70.5__-2.0

ViT-B/16

ResNet-50:

72.2 49 78.5 81.5

72.4 48.9 78.6 81.5

72.4 49.3 79.3 81.7

ViT-B/16:

DomainNet:

DomainNet

Clipart

Infograph

Painting

Quickdraw

Real

Sketch

avg

ResNet-50

51.6__-3.8

40.6__-0.9

53.4__-2.6

6.7__-0.4

73.4__-4.1

47.3__-2.4

45.5__-2.5

ViT-B/16

68.6__-2.7

49.5__-1.1

65.3__-1.5

15.8__-0.4

80.7__-3.0

61.7__-2.7

56.9__-2.0

ResNet-50:

51.5 40.7 53.5 6.7 73.6 47.3

51.7 40.4 53.4 6.7 73.3 47.3

51.5 40.7 53.4 6.8 73.2 47.4

ViT-B/16

68.7 49.6 65.3 15.9 80.8 61.8

68.4 49.4 65.2 15.9 80.6 61.6

68.8 49.5 65.3 15.7 80.8 61.7

报错:

1、ERROR: Ignored the following versions that require a different python version:

23.10.0 Requires-Python >=3.8; 23.10.1 Requires-Python >=3.8; 23.11.0 Requires-Python >=3.8; 23.12.0 Requires-Python >=3.8; 23.12.1 Requires-Python >=3.8; 23.7.0 Requires-Python >=3.8; 23.9.0 Requires-Python >=3.8; 23.9.1 Requires-Python >=3.8; 24.1.0 Requires-Python >=3.8; 24.1.1 Requires-Python >=3.8; 24.10.0 Requires-Python >=3.9; 24.1a1 Requires-Python >=3.8; 24.2.0 Requires-Python >=3.8; 24.3.0 Requires-Python >=3.8; 24.4.0 Requires-Python >=3.8; 24.4.1 Requires-Python >=3.8; 24.4.2 Requires-Python >=3.8; 24.8.0 Requires-Python >=3.8 ERROR: Could not find a version that satisfies the requirement clip==1.0 (from versions: 0.0.1, 0.1.0, 0.2.0) ERROR: No matching distribution found for clip==1.0 failed CondaEnvException: Pip failed

原因:直接使用作者github上面的environment.yml文件发生报错。里面的配置有的用python3.7,有的用3.8很混乱。搞不懂作者是怎么配置的。

但是使用我之前配置的虚拟环境也可以这场运行这篇论文的代码。

链接:zhanghr2001/PromptTA: Source-free Domain Generalization

这是我之前复现这篇论文的环境,根据readme,配置到requirement.txt就可以。 

2、连接超时Connection timed out'

requests.exceptions.ConnectionError: HTTPSConnectionPool(host='drive.google.com', port=443): Max retries exceeded with url: /uc?id=1gkbf_KaxoBws-GWT3XIPZ7BnkqbAxIFa (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f20626e8990>: Failed to establish a new connection: [Errno 110] Connection timed out'))

原因:要在作者给的github上的链接上面下载数据集,我用的之前的数据集,有一些问题。

3、ModuleNotFoundError: No module named ‘clip‘

命令:

pip install clip
pip install openai-clip

相关设置

1、数据集和模型名称设置

数据集:

PACS    VLCS     office_home_dg    domainnet:6个域文件+split文件夹(每个域的_train.txt和_test.txt)

模型名称:NET=resnet50_clip
vitb16_clip
vitl14_clip

2、运行命令

复现DPStyler命令:
sh run_clip_pacs.sh
sh run_clip_vlcs.sh
sh run_clip_office_home.sh
sh run_clip_domainnet.sh

这个作者还提供了复现PromptStyler的代码:

这个作者复现PromptStyler命令:
sh run_clip_pacs_ps.sh
sh run_clip_vlcs_ps.sh
sh run_clip_office_home_ps.sh
sh run_clip_domainnet_ps.sh


3、tensorboard命令查看

tensorboard --logdir ./output/vlcs/NS80_lr5_arcface_5_0.5_E100_resnet50_clip_R_wohead/seed3/tensorboard  --load_fast true  --port 6007

若显示端口被占用再加上 --load_fast true  --port 6007

http://www.lryc.cn/news/542257.html

相关文章:

  • 6.将cr打包成网络服务|使用postman进行测试|编写oj_server的服务路由功能(C++)
  • 基于SpringBoot + Vue的共享汽车(单车)管理系统设计与实现+毕业论文+开题报告+指导搭建视频
  • Day54(补)【AI思考】-SOA,Web服务以及无状态分步解析与示例说明
  • 回溯算法之组合和排列问题
  • gihub上适合练手的Python项目
  • 解锁CSnakes:.NET与Python的融合魔法
  • Python常见面试题的详解16
  • 建筑兔零基础自学python记录29|实战词云可视化项目——分人物阵营词云(上)7
  • Vi 编辑器基本使用指南
  • 22、《Spring Boot消息队列:RabbitMQ延迟队列与死信队列深度解析》
  • linux 命令+相关配置记录(持续更新...)
  • ssh工具
  • LLM大语言模型私有化部署-使用Dify的工作流编排打造专属AI诗词数据分析师
  • Windows 图形显示驱动开发-WDDM 3.2-自动显示切换(二)
  • 基于CentOS7安装kubesphere和Kubernetes并接入外部ES收集日志
  • 软考教材重点内容 信息安全工程师 第17章 网络安全应急响应技术原理与应用
  • 使用 DeepSeek + OmniParser v2 + UIAutomation 实现 GUI 应用自动化测试的探索
  • Spring Security面试题
  • 从零开始构建基于DeepSeek的智能客服系统
  • Linux故障排查和性能优化面试题及参考答案
  • 【无人集群系列---大疆无人集群技术进展、技术路线与未来发展方向】
  • 【亲测有效】百度Ueditor富文本编辑器添加插入视频、视频不显示、和插入视频后二次编辑视频标签不显示,显示成img标签,二次保存视频被替换问题,解决方案
  • ubuntu windows双系统踩坑
  • 嵌入式八股文(五)硬件电路篇
  • flink使用demo
  • OpenCV(8):图像直方图
  • 力扣LeetCode:1656 设计有序流
  • NGINX配置TCP负载均衡
  • vm和centos
  • c#丰田PLC ToyoPuc TCP协议快速读写 to c# Toyota PLC ToyoPuc读写