在跨模态检索对图片finetune时出现以下错误:
Loading vision model config from /mnt/e/Chinese-CLIP/cn_clip/clip/model_configs/ViT-B-16.json
Loading text model config from /mnt/e/Chinese-CLIP/cn_clip/clip/model_configs/RoBERTa-wwm-ext-base-chinese.json
Traceback (most recent call last):
File "/mnt/e/Chinese-CLIP/cn_clip/training/main.py", line 350, in main() File "/mnt/e/Chinese-CLIP/cn_clip/training/main.py", line 92, in main model_info['use_flash_attention'] = args.use_flash_attention AttributeError: 'Namespace' object has no attribute 'use_flash_attention'
[2024-02-28 18:02:40,299] torch.distributed.elastic.multiprocessing.api:
[ERROR] failed (exitcode: 1) local_rank: 0 (pid: 479) of binary: /usr/bin/python3 Traceback (most recent call last):
File "/home/abc/.local/bin/torchrun", line 8, in sys.exit(main()) File "/home/abc/.local/lib/python3.10/site-packages/torch/distributed/elastic/multiprocessing/errors/init.py", line 347, in wrapper return f(*args, **kwargs) File "/home/abc/.local/lib/python3.10/site-packages/torch/distributed/run.py", line 812, in main run(args) File "/home/abc/.local/lib/python3.10/site-packages/torch/distributed/run.py", line 803, in run elastic_launch( File "/home/abc/.local/lib/python3.10/site-packages/torch/distributed/launcher/api.py", line 135, in call return launch_agent(self._config, self._entrypoint, list(args)) File "/home/abc/.local/lib/python3.10/site-packages/torch/distributed/launcher/api.py", line 268, in launch_agent raise ChildFailedError( torch.distributed.elastic.multiprocessing.errors.ChildFailedError: ============================================================ /mnt/e/Chinese-CLIP/cn_clip/training/main.py FAILED ------------------------------------------------------------ Failures: ------------------------------------------------------------ Root Cause (first observed failure): [0]: time : 2024-02-28_18:02:40 host : LAPTOP-RH435GU1. rank : 0 (local_rank: 0) exitcode : 1 (pid: 479) error_file: <N/A> traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html ============================================================
解决方法:将类文件更新到最新(直接使用项目中的) 问题出在使用git clone下载代码库时并不是最新的代码 如果是使用Modelscope的环境建议卸载flash-attn![image](https://github.com/OFA-Sys/Chinese-CLIP/assets/98469234/1249a9e1-37e3-4110-b5b1-295420dc3c94)
因为没有安装flash-attn就不会调用
在跨模态检索对图片finetune时出现以下错误: Loading vision model config from /mnt/e/Chinese-CLIP/cn_clip/clip/model_configs/ViT-B-16.json main() File "/mnt/e/Chinese-CLIP/cn_clip/training/main.py", line 92, in main model_info['use_flash_attention'] = args.use_flash_attention sys.exit(main()) File "/home/abc/.local/lib/python3.10/site-packages/torch/distributed/elastic/multiprocessing/errors/init.py", line 347, in wrapper return f(*args, **kwargs) File "/home/abc/.local/lib/python3.10/site-packages/torch/distributed/run.py", line 812, in main run(args) File "/home/abc/.local/lib/python3.10/site-packages/torch/distributed/run.py", line 803, in run elastic_launch( File "/home/abc/.local/lib/python3.10/site-packages/torch/distributed/launcher/api.py", line 135, in call return launch_agent(self._config, self._entrypoint, list(args)) File "/home/abc/.local/lib/python3.10/site-packages/torch/distributed/launcher/api.py", line 268, in launch_agent raise ChildFailedError( torch.distributed.elastic.multiprocessing.errors.ChildFailedError: ============================================================ /mnt/e/Chinese-CLIP/cn_clip/training/main.py FAILED ------------------------------------------------------------ Failures: ------------------------------------------------------------ Root Cause (first observed failure): [0]: time : 2024-02-28_18:02:40 host : LAPTOP-RH435GU1. rank : 0 (local_rank: 0) exitcode : 1 (pid: 479) error_file: <N/A> traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html ============================================================
Loading text model config from /mnt/e/Chinese-CLIP/cn_clip/clip/model_configs/RoBERTa-wwm-ext-base-chinese.json
Traceback (most recent call last):
File "/mnt/e/Chinese-CLIP/cn_clip/training/main.py", line 350, in
AttributeError: 'Namespace' object has no attribute 'use_flash_attention'
[2024-02-28 18:02:40,299] torch.distributed.elastic.multiprocessing.api: [ERROR] failed (exitcode: 1) local_rank: 0 (pid: 479) of binary: /usr/bin/python3 Traceback (most recent call last):
File "/home/abc/.local/bin/torchrun", line 8, in