Git Product home page Git Product logo

Comments (7)

danjuan-77 avatar danjuan-77 commented on September 22, 2024

如果是测试的话,使用test.jsonl格式应该是这样的:

{"image": "图片路径", "bbox": [[279, 134, 358, 231], [28, 93, 121, 221], [0, 371, 99, 497]], "height": 512, "width": 512}

关于测试使用的Prompt,可以在evaluate_grounding.py找到Prompt设置

from qwen-vl.

yihp avatar yihp commented on September 22, 2024

@danjuan-77 感谢回复,我还有两个问题想要请教您~
第一个就是关于grounding微调是否也需要加上 "height": 512, "width": 512,我之前微调没有加上这个参数
第二个想询问下关于evaluate_vqa.py的测试数据格式
感激不尽!

from qwen-vl.

danjuan-77 avatar danjuan-77 commented on September 22, 2024

@danjuan-77 感谢回复,我还有两个问题想要请教您~ 第一个就是关于grounding微调是否也需要加上 "height": 512, "width": 512,我之前微调没有加上这个参数 第二个想询问下关于evaluate_vqa.py的测试数据格式 感激不尽!

关于数据格式,可以参考这个文件中的说明:eval_mm/EVALUATION.md 里面有Qwen测试数据的下载地址可以参考一下,grounding微调是需要加入图片的宽高参数,因为Qwen需要对坐标进行归一化,在evaluate_grounding.py大约246行可以看到。
由于我只做了目标检测相关的任务微调,vqa我不太了解,eval_mm/EVALUATION.md里面应该会有相关数据下载地址,可以下载下来看看。

from qwen-vl.

yihp avatar yihp commented on September 22, 2024

@danjuan-77 好嘞感谢!我刚刚正在看

from qwen-vl.

AlexMa0 avatar AlexMa0 commented on September 22, 2024

你好,请问您在使用Qwen-VL\eval_mm\evaluate_grounding.py进行测试试的命令是什么呢?
我在evaluate_caption.py测试格式是:
ds="nocaps"
checkpoint=/data/checkpoint/qwen/Qwen-VL-Chat
python -m torch.distributed.run
--nproc_per_node 1
--nnodes 1
--node_rank 0
--master_addr ${MASTER_ADDR:-127.0.0.1}
--master_port 12345
evaluate_caption.py
--checkpoint $checkpoint
--dataset $ds
--batch-size 8
--num-workers 2
数据集也已经下载好但是会出现没有图片地址的报错:
Traceback (most recent call last):
File "/data/checkpoint/qwen/Qwen-VL-Chat/eval_mm/evaluate_caption.py", line 143, in
pred = model.generate(
File "/root/.cache/huggingface/modules/transformers_modules/Qwen-VL-Chat/modeling_qwen.py", line 1058, in generate
return super().generate(
File "/root/conda/envs/llm/lib/python3.9/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
return func(*args, **kwargs)
File "/root/conda/envs/llm/lib/python3.9/site-packages/transformers/generation/utils.py", line 1722, in generate
return self.beam_sample(
File "/root/conda/envs/llm/lib/python3.9/site-packages/transformers/generation/utils.py", line 3350, in beam_sample
outputs = self(
File "/root/conda/envs/llm/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/Qwen-VL-Chat/modeling_qwen.py", line 848, in forward
transformer_outputs = self.transformer(
File "/root/conda/envs/llm/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "/root/.cache/huggingface/modules/transformers_modules/Qwen-VL-Chat/modeling_qwen.py", line 565, in forward
images = self.visual.encode(images)
File "/root/.cache/huggingface/modules/transformers_modules/Qwen-VL-Chat/visual.py", line 422, in encode
image = Image.open(image_path)
File "/root/conda/envs/llm/lib/python3.9/site-packages/PIL/Image.py", line 3247, in open
fp = builtins.open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'data/nocaps/val/0013ea2087020901.jpg'
请问您有遇到过吗?

from qwen-vl.

yihp avatar yihp commented on September 22, 2024

这个错误FileNotFoundError: [Errno 2] No such file or directory: 'data/nocaps/val/0013ea2087020901.jpg',文件地址你得对应上,修改为自己下载保存的路径

from qwen-vl.

AlexMa0 avatar AlexMa0 commented on September 22, 2024

@yihp 地址是已经修改好的,在evaluate_caption.py的ds_collections部分,按照mkdir -p data/nocaps && cd data/nocaps的,地址已经设置为:/data/checkpoint/qwen/Qwen-VL-Chat/data/nocaps/nocaps_val.json。。但是报错的是data/nocaps/val/0013ea2087020901.jpg。下载好的nocaps文件夹下是没有val这个子文件。只有一个nocaps_val.json。

from qwen-vl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.