Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oscar_split_ViT-B_32_train_512.pkl文件的来源 #27

Open
masaiaaaa opened this issue Mar 6, 2023 · 12 comments
Open

oscar_split_ViT-B_32_train_512.pkl文件的来源 #27

masaiaaaa opened this issue Mar 6, 2023 · 12 comments

Comments

@masaiaaaa
Copy link

请问您的这个文件是怎么从数据集处理得到的呢,我看到这个里边的内容包含的image_id有113287,这个数字比train多,又不够tran+val的。能否提供下处理数据集得到这个文件的过程?

@buxiangzhiren
Copy link
Owner

buxiangzhiren commented Mar 6, 2023

我们的代码是根据clip prefix改的,生成文件的code在这里 https://github.com/rmokady/CLIP_prefix_caption. 命令是 python parse_coco.py --clip_model_type ViT-B/32。但是后面我们改成online 提取clip feature了,所以这个文件相当于只提供image id index。

@masaiaaaa
Copy link
Author

明白,这个pkl只提供了imageid,后边没有用clip embedding。我主要是纳闷这个文件里包含的imageid个数为113287,这个size处于triain与train+val之间。
image

@buxiangzhiren
Copy link
Owner

这里应该是train+部分val dataset的数据
image

@buxiangzhiren
Copy link
Owner

因为caption这边split之后的val dataset和test dataset是各5000张,所以感觉应该是加了原始val dataset里面的数据

@masaiaaaa
Copy link
Author

明白了,谢谢

@Sparkle-Q
Copy link

我运行python parse_coco.py --clip_model_type ViT-B/32这个命令时出现Traceback (most recent call last):
File "parse_coco.py", line 132, in
exit(main(args.clip_model_type))
File "parse_coco.py", line 53, in main
clip_model, _ = clip.load(clip_model_type, device=device, jit=False)
File "/home/b309/16T/xyq/DDCap/clip1/clip.py", line 96, in load
if ((dist.is_initialized() or dist.is_available()) and int(dist.get_rank()) == 0) or not dist.is_available():
File "/home/b309/16T/miniconda3/envs/DDCap/lib/python3.8/site-packages/torch/distributed/distributed_c10d.py", line 725, in get_rank
default_pg = _get_default_group()
File "/home/b309/16T/miniconda3/envs/DDCap/lib/python3.8/site-packages/torch/distributed/distributed_c10d.py", line 358, in _get_default_group
raise RuntimeError("Default process group has not been initialized, "
RuntimeError: Default process group has not been initialized, please make sure to call init_process_group.

请问怎么解决?

@buxiangzhiren
Copy link
Owner

你没有使用ddp多卡对吧?如果用多卡的时候就没有这个问题。然后如果你想单卡跑,把这个if删了就行
if ((dist.is_initialized() or dist.is_available()) and int(dist.get_rank()) == 0) or not dist.is_available():
model_path = _download(_MODELS[name])

@buxiangzhiren
Copy link
Owner

你没有使用ddp多卡对吧?如果用多卡的时候就没有这个问题。然后如果你想单卡跑,把这个if删了就行 if ((dist.is_initialized() or dist.is_available()) and int(dist.get_rank()) == 0) or not dist.is_available(): model_path = _download(_MODELS[name])

https://github.com/buxiangzhiren/DDCap/blob/main/clip1/clip.py#LL96C1-L98C23,98行也删

@Sparkle-Q
Copy link

你没有使用ddp多卡对吧?如果用多卡的时候就没有这个问题。然后如果你想单卡跑,把这个if删了就行 if ((dist.is_initialized() or dist.is_available()) and int(dist.get_rank()) == 0) or not dist.is_available(): model_path = _download(_MODELS[name])

https://github.com/buxiangzhiren/DDCap/blob/main/clip1/clip.py#LL96C1-L98C23,98行也删

我没有使用多卡,后面我使用原来这个 https://github.com/rmokady/CLIP_prefix_caption就不会出现问题了。谢谢你!

@rongtongxueya
Copy link

clip_model_type ViT-B/

我很想知道,这个代码产生的pkl里面没有clip_embedding啊,我看博主的代码里面pkl里面有clip_embedding,不知道这个参数有没有用后面,我没详细的看代码,现在只想跑起来然后再调试看一下,能告诉我这个clip_embedding有没有用吗,谢谢

@rongtongxueya
Copy link

没有用clip embedding。我主要是纳闷这个文件里包含的imageid个数为113287,这个size处于triain与train+val之间。

看了你的答案我想我应该有点明白了,这个clip-embedding应该没用到

@rongtongxueya
Copy link

我好奇,这个pkl难道只提供image id 和index,不提供caption吗,这个模型算是无监督训练的吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants