OFA-Sys / Chinese-CLIP

Chinese version of CLIP which achieves Chinese cross-modal retrieval and representation generation.
MIT License
4.21k stars 439 forks source link

AttributeError: 'Namespace' object has no attribute 'use_flash_attention' #261

Closed IF-chan closed 4 months ago

IF-chan commented 5 months ago

解决方法:将类文件更新到最新(直接使用项目中的) 问题出在使用git clone下载代码库时并不是最新的代码 如果是使用Modelscope的环境建议卸载flash-attn 因为没有安装flash-attn就不会调用 image

在跨模态检索对图片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 ============================================================

Daydaylight commented 5 months ago

请问解决了吗?我也遇到了这一问题。

IF-chan commented 5 months ago

请问解决了吗?我也遇到了这一问题。

没有把类文件更新到最新

iWangTing commented 4 months ago

请问解决了吗?我也遇到了这一问题。

没有把类文件更新到最新 我也遇到了这个问题,请问可以详细讲一下解决方法吗?感谢!

IF-chan commented 4 months ago

请问解决了吗?我也遇到了这一问题。

没有把类文件更新到最新 我也遇到了这个问题,请问可以详细讲一下解决方法吗?感谢!

就是下载项目里最新的文件啊