[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-om-ai-lab--VLM-R1":3,"tool-om-ai-lab--VLM-R1":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",150037,2,"2026-04-10T23:33:47",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":76,"owner_email":76,"owner_twitter":77,"owner_website":76,"owner_url":78,"languages":79,"stars":96,"forks":97,"last_commit_at":98,"license":99,"difficulty_score":100,"env_os":101,"env_gpu":102,"env_ram":103,"env_deps":104,"category_tags":111,"github_topics":113,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":124,"updated_at":125,"faqs":126,"releases":155},4952,"om-ai-lab\u002FVLM-R1","VLM-R1","Solve Visual Understanding with Reinforced VLMs","VLM-R1 是一款稳定且具备强大泛化能力的视觉语言大模型，旨在通过强化学习技术解决复杂的视觉理解任务。它核心解决了传统监督微调（SFT）模型在面对陌生场景时性能下降、推理能力不足的痛点。实验表明，随着训练深入，VLM-R1 不仅能持续提升域内数据的表现，更能将推理能力有效迁移至域外数据，实现真正的举一反三。\n\n该工具特别适合 AI 研究人员和开发者使用，尤其是那些希望探索“类 R1\"推理机制在多模态领域应用的技术团队。VLM-R1 基于 Qwen2.5-VL 等先进架构，支持完整的 GRPO 强化学习微调、LoRA 高效微调以及多节点分布式训练，并兼容多图像输入。其独特亮点在于卓越的数学推理与开放词汇检测能力：参数量不足 4B 的数学模型曾登顶 Open-Compass 榜单，而开放词汇检测模型则在 OVDEval 评测中达到业界领先水平。此外，项目近期还针对华为昇腾硬件进行了深度优化，显著提升了推理速度与吞吐量，为高性能部署提供了坚实支持。","# VLM-R1: A stable and generalizable R1-style Large Vision-Language Model\n\n\u003Cfont size=4>\u003Cdiv align='center' > [[🤗 REC Demo](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fomlab\u002FVLM-R1-Referral-Expression)] [[🤗 OVD Demo](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fomlab\u002FVLM-R1-OVD)] [[🤗 REC Data](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fomlab\u002FVLM-R1)] [[🤗 Checkpoints](https:\u002F\u002Fhuggingface.co\u002Fcollections\u002Fomlab\u002Fvlm-r1-models-67b7352db15c19d57157c348)] [[ModelScope Checkpoints](https:\u002F\u002Fmodelscope.cn\u002Fcollections\u002FOm_AI_Lab\u002FVLM-R1-models)] \u003C\u002Fdiv>\u003C\u002Ffont>\n\n\u003Cfont size=4>\u003Cdiv align='center'>[[📄 Tech Report](https:\u002F\u002Farxiv.org\u002Fabs\u002F2504.07615)] [[📝 Blog](https:\u002F\u002Fom-ai-lab.github.io\u002Findex.html)]\u003C\u002Fdiv>\u003C\u002Ffont>\n\n\u003Cdiv align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fom-ai-lab_VLM-R1_readme_2d1de61a46cf.png\" width=\"900\"\u002F>\n\u003Cdiv>\n  \u003Cfont size=4>\n    \u003Cp>🎉  \u003Cb>Our VLM-R1 Math model reaches the top of the Open-Compass Math Leaderboard (under 4B parameters) and OVD model achieves the state-of-the-art performance on OVDEval.\u003C\u002Fb>\u003C\u002Fp>\n  \u003C\u002Ffont>\n\u003C\u002Fdiv>\n\u003C\u002Fdiv>\n\nSince the introduction of [Deepseek-R1](https:\u002F\u002Fgithub.com\u002Fdeepseek-ai\u002FDeepSeek-R1), numerous works have emerged focusing on reproducing and improving upon it. In this project, we propose VLM-R1, a stable and generalizable R1-style Large Vision-Language Model.\n\nSpecifically, for the task of Referring Expression Comprehension (REC), we trained [Qwen2.5-VL](https:\u002F\u002Fgithub.com\u002FQwenLM\u002FQwen2.5-VL) using both R1 and SFT approaches. The results reveal that, on the in-domain test data, the performance of the SFT model shows little change compared to that of the R1 model base model when the number of training steps is relatively small (100–600 steps), while the R1 model shows a steady improvement (as shown at the left of the figure below). More importantly, on the out-of-domain test data, the SFT model's performance deteriorates slightly as the number of steps increases. Nevertheless, the RL model generalizes its reasoning ability to the out-of-domain data (as shown at the right of the figure below).\n\n![image](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fom-ai-lab_VLM-R1_readme_16305e422813.png)\n\\* *We found previous REC SFT exps used a mismatch pixel config. Therefore, we re-run the study with the correct config on a more complex out-of-domain data. See our [findings](https:\u002F\u002Fom-ai-lab.github.io\u002F2025_03_24.html) for details.*\n\n## 🚀 Features\n\nThis repository supports:\n\n- **`Full Fine-tuning for GRPO`**: see [run_grpo_rec.sh](run_scripts\u002Frun_grpo_rec.sh)\n- **`Freeze Vision Modules`**: set `freeze_vision_modules` as `true` in the script.\n- **`LoRA Fine-tuning for GRPO`**: see [run_grpo_rec_lora.sh](run_scripts\u002Frun_grpo_rec_lora.sh)\n- **`Multi-node Training`**: see [multinode_training_demo.sh](run_scripts\u002Fmultinode_training_demo.sh)\n- **`Multi-image Input Training`**: see [run_grpo_gui.sh](run_scripts\u002Frun_grpo_gui.sh)\n- **`For your own data`**: see [here](#for-your-own-data)\n- **`Various VLMs`**: see [How to add a new model](assets\u002Fadd_new_model.md), now we support QwenVL and InternVL\n\n## 🗞️ Update\n\n- **`2025-08-29`**: 🔥🔥🔥 We have further optimized the VLM-R1 series models based on JD's latest open-source inference framework `xllm` (github is [here](https:\u002F\u002Fgithub.com\u002Fjd-opensource\u002Fxllm)). The TTFT (Time to First Token) has been reduced by 50% compared to `vllm-ascend`, and the overall throughput has increased by 127% compared to `vllm-ascend`. Please refer to [ascend_inference\u002F910B\u002Fxllm\u002FREADME.md](ascend_inference\u002F910B\u002Fxllm\u002FREADME.md) for more details.\n\n- **`2025-08-22`**: We have adapted the VLM-R1 series models to Huawei Ascend Atlas 800T A2 and Atlas 300I Duo series using the vllm-ascend framework, further expanding the deployment scenarios and hardware compatibility of the model series. Please refer to [ascend_inference\u002F910B\u002Fvllm_ascend\u002FREADME.md](ascend_inference\u002F910B\u002Fvllm_ascend\u002FREADME.md) and [ascend_inference\u002F300IDuo\u002FREADME.md](ascend_inference\u002F300IDuo\u002FREADME.md) for more details.\n\n- **`2025-06-26`**: We introduce a post-resize operation for the bounding box for QwenVL (both [training](src\u002Fopen-r1-multimodal\u002Fsrc\u002Fopen_r1\u002Fvlm_modules\u002Fqwen_module.py#L124-L129) and [evaluation](src\u002Feval\u002Ftest_rec_r1.py#L92-L97)) and the results are improved slightly.\n- **`2025-04-16`**: We have updated the codebase to improve functionality and maintain unified implementation. Specifically, the REC process is now integrated into [grpo_jsonl.py](src\u002Fopen-r1-multimodal\u002Fsrc\u002Fopen_r1\u002Fgrpo_jsonl.py) for consistency across tasks. Additionally, we introduce a new parameter, `is_reward_customized_from_vlm_module`, which enables the use of customized reward functions defined within the VLM module. When set to `true`, the reward logic is handled in either [QwenVL2Module](src\u002Fopen-r1-multimodal\u002Fsrc\u002Fopen_r1\u002Fvlm_modules\u002Fqwen_module.py) or [InternVLModule](src\u002Fopen-r1-multimodal\u002Fsrc\u002Fopen_r1\u002Fvlm_modules\u002Finternvl_module.py), depending on the selected model. Furthermore, the training log has been enhanced to provide more detailed output for easier monitoring and debugging.\n- **`2025-04-11`**: 🔥🔥🔥 We release the [technical report](https:\u002F\u002Farxiv.org\u002Fabs\u002F2504.07615) of VLM-R1, summarizing our main results and insights.\n- **`2025-04-03`**: We add the `odLength`, `weighted_sum`, and `cosine` reward used in OVD task, please refer our [blog post](https:\u002F\u002Fom-ai-lab.github.io\u002F2025_03_20.html) and [findings](https:\u002F\u002Fom-ai-lab.github.io\u002F2025_03_24.html) to the details of the reward usage and see [grpo_jsonl.py](src\u002Fopen-r1-multimodal\u002Fsrc\u002Fopen_r1\u002Fgrpo_jsonl.py) for code implementation.\n- **`2025-03-24`**: 🔥 We release the [findings](https:\u002F\u002Fom-ai-lab.github.io\u002F2025_03_24.html) of VLM-R1-OVD.\n- **`2025-03-23`**: 🔥 We release the VLM-R1-OVD [model weights](https:\u002F\u002Fhuggingface.co\u002Fomlab\u002FVLM-R1-Qwen2.5VL-3B-OVD-0321) and [demo](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fomlab\u002FVLM-R1-OVD), which shows the state-of-the-art performance on OVDEval. Welcome to use it.\n- **`2025-03-20`**: 🔥 We achieved SOTA results on [OVDEval](https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FOVDEval) with our RL-based model, outperforming SFT baselines and specialized object detection models. Read our [blog post](https:\u002F\u002Fom-ai-lab.github.io\u002F2025_03_20.html) for details on how reinforcement learning enhances object detection performance.\n- **`2025-03-17`**: Our VLM-R1 Math model reaches the top of the [Open-Compass Math Leaderboard](https:\u002F\u002Frank.opencompass.org.cn\u002Fleaderboard-multimodal-reasoning\u002F?m=REALTIME) (under 4B parameters). We have released the [checkpoint](https:\u002F\u002Fhuggingface.co\u002Fomlab\u002FVLM-R1-Qwen2.5VL-3B-Math-0305).\n- **`2025-03-15`**: We support multi-image input data. Check the format of multi-image input [here](#for-your-own-data). We also provide an example of multi-image script [run_grpo_gui.sh](run_scripts\u002Frun_grpo_gui.sh), see [here](#for-your-own-data) for details.\n- **`2025-03-13`**: We support InternVL for GRPO. See [run_grpo_rec_internvl.sh](run_scripts\u002Frun_grpo_rec_internvl.sh) for details. The annotation json files used in InternVL are [here](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fomlab\u002FVLM-R1\u002Fresolve\u002Fmain\u002Frec_jsons_internvl.zip). If you want to add your new model, please refer to [How to add a new model](assets\u002Fadd_new_model.md).\n- **`2025-03-02`**: We support LoRA Fine-tuning for GRPO. See [run_grpo_rec_lora.sh](run_scripts\u002Frun_grpo_rec_lora.sh) for details.\n- **`2025-02-27`**: We support the `number of iterations per batch` and `epsilon value for clipping` in the original GRPO algorithm with args: `--num_iterations` and `--epsilon`.\n- **`2025-02-25`**: We support multi-node training for GRPO. See [multinode_training_demo.sh](run_scripts\u002Fmultinode_training_demo.sh) for details.\n- **`2025-02-21`**: We release the [checkpoint](https:\u002F\u002Fhuggingface.co\u002Fomlab\u002FQwen2.5VL-3B-VLM-R1-REC-500steps) of the VLM-R1 REC model.\n- **`2025-02-20`**: We release the script for [general data loading](#for-your-own-data).\n- **`2025-02-19`**: We incorporate an explanation of the [SFT](#sft) method.\n- **`2025-02-17`**: We release the VLM-R1 REC [Demo](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fomlab\u002FVLM-R1-Referral-Expression) on Hugging Face Spaces.\n- **`2025-02-15`**: We release the VLM-R1 repository and [GRPO](#grpo) training script.\n\n## 🤖 Models\n\n- **[`OVD`](https:\u002F\u002Fhuggingface.co\u002Fomlab\u002FVLM-R1-Qwen2.5VL-3B-OVD-0321)**: Trained with VLM-R1, our Open-Vocabulary Detection (OVD) model achieves the state-of-the-art performance on OVDEval.\n- **[`Math`](https:\u002F\u002Fhuggingface.co\u002Fomlab\u002FVLM-R1-Qwen2.5VL-3B-Math-0305)**: Through VLM-R1 training, our math model focuses on multimodal reasoning tasks and has achieved Top1 on the OpenCompass Multi-modal Reasoning Leaderboard among models \u003C 4B.\n- **[`REC`](https:\u002F\u002Fhuggingface.co\u002Fomlab\u002FQwen2.5VL-3B-VLM-R1-REC-500steps)**: Trained with VLM-R1, our Referring Expression Comprehension (REC) model showcases the superior performance on out-of-domain data and a series of reasoning-grounding tasks.\n- **[`GUI`](https:\u002F\u002Fhuggingface.co\u002Fkonkazzz\u002FGT-r1)**: Trained with VLM-R1, our GUI Defect Detection model outperforms both base and SFT models by achieving the best accuracy and improved generalization across both defective and clean screens.\n\n| Version                          | Base VLM     | Checkpoint                                                                                           | Task Type                 |\n| -------------------------------- | ------------ | ---------------------------------------------------------------------------------------------------- | ------------------------- |\n| VLM-R1-Qwen2.5VL-3B-OVD-0321     | Qwen2.5VL-3B | [omlab\u002FVLM-R1-Qwen2.5VL-3B-OVD-0321](https:\u002F\u002Fhuggingface.co\u002Fomlab\u002FVLM-R1-Qwen2.5VL-3B-OVD-0321)         | Open-Vocabulary Detection |\n| VLM-R1-Qwen2.5VL-3B-Math-0305    | Qwen2.5VL-3B | [omlab\u002FVLM-R1-Qwen2.5VL-3B-Math-0305](https:\u002F\u002Fhuggingface.co\u002Fomlab\u002FVLM-R1-Qwen2.5VL-3B-Math-0305)       | Multi-Modal Math          |\n| VLM-R1-Qwen2.5VL-3B-REC-500steps | Qwen2.5VL-3B | [omlab\u002FQwen2.5VL-3B-VLM-R1-REC-500steps](https:\u002F\u002Fhuggingface.co\u002Fomlab\u002FQwen2.5VL-3B-VLM-R1-REC-500steps) | REC\u002FReasoning-Grounding   |\n\n## 🎯 ToDo\n\n- [X] Implement multi-node training.\n- [X] Implement LoRA Fine-tuning.\n- [X] Support more Multimodal LLMs.\n- [X] Support multi-image input.\n- [X] Release the VLM-R1 Math model.\n- [X] Release the blog of VLM-R1.\n- [X] Release the VLM-R1-OVD model.\n- [X] Release the technical report of VLM-R1.\n- [X] Adapt to Huawei Ascend Atlas 800T A2 and Atlas 300I Duo series using the vllm-ascend framework.\n- [X] Adapt to Huawei Ascend Atlas 800T A2 series using the xllm framework.\n- [ ] Study cross task generalization.\n- [ ] Enhance VLM for other tasks [welcome issue].\n\n## 🛠️ Setup\n\n```bash\nconda create -n vlm-r1 python=3.10\nconda activate vlm-r1\nbash setup.sh\n```\n\n## 💪🏻 Training\n\n### Referring Expression Comprehension (REC)\n\n#### 📚 GRPO\n\n1. Download the [COCO Train2014 image](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fomlab\u002FVLM-R1\u002Fresolve\u002Fmain\u002Ftrain2014.zip) and unzip it, and we refer to the image dir as `\u003Cyour_image_root>`.\n2. Download the [RefCOCO\u002F+\u002Fg and LISA-Grounding Annotation files](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fomlab\u002FVLM-R1\u002Fresolve\u002Fmain\u002Frec_jsons_processed.zip) and unzip it (LISA-Grounding is used for out-of-domain evaluation).\n3. Change the `data_paths` and `image_folders` in the [run_scripts\u002Frun_grpo_rec.sh](run_scripts\u002Frun_grpo_rec.sh) file.\n\n```bash\n# These jsonl files are included in the annotation files at step 2.\n# Note: please use jsonl files instead of json files.\ndata_paths=\"path\u002Fto\u002Frefcoco_train.jsonl:path\u002Fto\u002Frefcocop_train.jsonl:path\u002Fto\u002Frefcocog_train.jsonl\"\nimage_folders=\"path\u002Fto\u002Fcoco:path\u002Fto\u002Fcoco:path\u002Fto\u002Fcoco\"\n```\n\n4. ``bash run_scripts\u002Frun_grpo_rec.sh``\n\n> [!NOTE]\n> If you encounter 'CUDA out of memory' error, you can try to reduce the `per_device_train_batch_size`.\n\n\u003Cdiv align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fom-ai-lab_VLM-R1_readme_191f6869692a.jpg\" width=\"750\"\u002F>\n\u003C\u002Fdiv>\n\u003C!-- ![image](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fom-ai-lab_VLM-R1_readme_b6e6c5c7959b.jpg) -->\n\n#### 📚 Multi-Node GRPO\n\nFor multi-node training, please refers to [multinode_training_demo.sh](src\u002Fopen-r1-multimodal\u002Fmultinode_training_demo.sh).\n\n#### 📚 SFT\n\nWe use [LLaMA-Factory](https:\u002F\u002Fgithub.com\u002Fhiyouga\u002FLLaMA-Factory) to train the SFT model.\n\n1. Clone the [LLaMA-Factory](https:\u002F\u002Fgithub.com\u002Fhiyouga\u002FLLaMA-Factory) repository and install the dependencies.\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fhiyouga\u002FLLaMA-Factory.git\ncd LLaMA-Factory\npip install -e \".[torch,metrics]\"\n```\n\n2. Download the dataset_info.json, mllm_rec_json.json, and qwen2_5_vl_full_sft.yaml we provided [here](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fomlab\u002FVLM-R1\u002Ftree\u002Fmain\u002Fsft_related). Put the json files in the `LLaMA-Factory\u002Fdata` directory and the yaml file in the `LLaMA-Factory\u002Fexamples\u002Ftrain_full` directory.\n3. Run the following command to train the SFT model.\n\n```bash\nllamafactory-cli train examples\u002Ftrain_full\u002Fqwen2_5_vl_full_sft.yaml\n```\n\n### For your own data\n\n\u003Cdiv style=\"text-align: justify;\">\n\nWe support data loading the jsonl data of this format in [`src\u002Fopen-r1-multimodal\u002Fsrc\u002Fopen_r1\u002Fgrpo_jsonl.py`](src\u002Fopen-r1-multimodal\u002Fsrc\u002Fopen_r1\u002Fgrpo_jsonl.py). Please note that you may need to use different reward functions for your specialized tasks. Welcome to PR to add your own reward functions or share any other interesting findings!\n\n\u003C\u002Fdiv>\n\nThe jsonl has the format as follows:\n\n```json\n{\n  \"id\": 1,\n  \"image\": \"Clevr_CoGenT_TrainA_R1\u002Fdata\u002Fimages\u002FCLEVR_trainA_000001_16885.png\",\n  \"conversations\": [\n    {\"from\": \"human\", \"value\": \"\u003Cimage>What number of purple metallic balls are there?\"},\n    {\"from\": \"gpt\", \"value\": \"0\"}\n  ]\n}\n```\n\nIf you want to use multi-image input, you can use the following format:\n\n```json\n{\n  \"id\": 1,\n  \"image\": [\"Clevr_CoGenT_TrainA_R1\u002Fdata\u002Fimages\u002FCLEVR_trainA_000001_16885.png\", \"Clevr_CoGenT_TrainA_R1\u002Fdata\u002Fimages\u002FCLEVR_trainA_000001_16886.png\"],\n  \"conversations\": [\n    {\"from\": \"human\", \"value\": \"\u003Cimage>\u003Cimage>What number of purple metallic balls in total within the two images?\"},\n    {\"from\": \"gpt\", \"value\": \"3\"}\n  ]\n}\n```\n\n> [!NOTE]\n> The image path in the jsonl file should be relative to the image folder specified in `--image_folders`. The absolute path of the input image is constructed as `os.path.join(image_folder, data['image'])`. For example:\n\n- If your jsonl has `\"image\": \"folder1\u002Fimage1.jpg\"`\n- And you specify `--image_folders \"\u002Fpath\u002Fto\u002Fimages\u002F\"`\n- The full image path will be `\u002Fpath\u002Fto\u002Fimages\u002Ffolder1\u002Fimage1.jpg`\n\nMultiple data files and image folders can be specified using \":\" as a separator:\n\n```bash\n--data_file_paths \u002Fpath\u002Fto\u002Fdata1.jsonl:\u002Fpath\u002Fto\u002Fdata2.jsonl \\\n--image_folders \u002Fpath\u002Fto\u002Fimages1\u002F:\u002Fpath\u002Fto\u002Fimages2\u002F\n```\n\nThe script can be run like this:\n\n```bash\n# You could refer to the run_grpo_rec.sh for the example\ntorchrun --nproc_per_node=\"8\" \\\n    --nnodes=\"1\" \\\n    --node_rank=\"0\" \\\n    --master_addr=\"127.0.0.1\" \\\n    --master_port=\"12345\" \\\n  src\u002Fopen_r1\u002Fgrpo_jsonl.py \\\n    --output_dir output\u002F$RUN_NAME \\\n    --model_name_or_path Qwen\u002FQwen2.5-VL-3B-Instruct \\\n    --deepspeed ${REPO_HOME}\u002Fsrc\u002Fopen-r1-multimodal\u002Flocal_scripts\u002Fzero3.json \\\n    --data_file_paths \u002Fpath\u002Fto\u002Fyour\u002Fdata.jsonl \\ # can be multiple, separated by \":\"\n    --image_folders \u002Fpath\u002Fto\u002Fyour\u002Fimage\u002Ffolder \\ # can be multiple, separated by \":\"\n    ...\n```\n\n\u003Cdiv style=\"text-align: justify;\">\n\n### Multi-image Input\nWe provide an example of multi-image script [run_grpo_gui.sh](src\u002Fopen-r1-multimodal\u002Frun_scripts\u002Frun_grpo_gui.sh). This task requires the model to analyze two GUI screenshots, taken before and after a user action, to determine if any UI interaction defects are present, which is from [GUI-Testing-Arena](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fsongjah\u002FGTArena-UI-Defects). Download the [image](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fomlab\u002FVLM-R1\u002Fresolve\u002Fmain\u002Fgui_multi-image.zip) and unzip it into the `\u002Fpath\u002Fto\u002Fimages\u002F`. Then modify the `image_folders` parameter in the script and run it.\n\n```bash\nbash run_scripts\u002Frun_grpo_gui.sh\n```\n\n\u003C\u002Fdiv>\n\n## 📊 Evaluation\n\n![image](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fom-ai-lab_VLM-R1_readme_aa7d12895ce0.png)\n\n1. Download the provided [LISA-Grounding images](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fomlab\u002FVLM-R1\u002Fresolve\u002Fmain\u002Flisa-test.zip).\n\n```bash\ncd .\u002Fsrc\u002Feval\n\n# Remember to change the model path, image root, and annotation path in the script\ntorchrun --nproc_per_node=X test_rec_r1.py # for GRPO. 'X' is the number of GPUs you have.\ntorchrun --nproc_per_node=X test_rec_baseline.py # for SFT.\n```\n\n## 🔍 Ascend Inference\n\nWe have adapted the VLM-R1 series models to Huawei Ascend Atlas 800T A2 and Atlas 300I Duo series using the vllm-ascend framework. The specific adaptation and inference are as follows:\n\n- **Atlas 800T A2**: Please refer to [ascend_inference\u002F910B\u002Fvllm_ascend\u002FREADME.md](ascend_inference\u002F910B\u002Fvllm_ascend\u002FREADME.md)\n- **Atlas 300I Duo**: Please refer to [ascend_inference\u002F300IDuo\u002FREADME.md](ascend_inference\u002F300IDuo\u002FREADME.md)\n\n## 🤝 Acknowledgements\n\nWe would like to express our sincere gratitude to [DeepSeek](https:\u002F\u002Fgithub.com\u002Fdeepseek-ai\u002FDeepSeek-R1), [Open-R1](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fopen-r1), [QwenVL](https:\u002F\u002Fgithub.com\u002FQwenLM\u002FQwen2.5-VL), [Open-R1-Multimodal](https:\u002F\u002Fgithub.com\u002FEvolvingLMMs-Lab\u002Fopen-r1-multimodal), [R1-V](https:\u002F\u002Fgithub.com\u002FDeep-Agent\u002FR1-V), [RefCOCO](https:\u002F\u002Fgithub.com\u002Flichengunc\u002Frefer), [RefGTA](https:\u002F\u002Fgithub.com\u002Fmikittt\u002Feasy-to-understand-REG\u002Ftree\u002Fmaster\u002Fpyutils\u002Frefer2), [LLaMA-Factory](https:\u002F\u002Fgithub.com\u002Fhiyouga\u002FLLaMA-Factory), [OVDEval](https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FOVDEval), [GUI-Testing-Arena](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fsongjah\u002FGTArena-UI-Defects), and [LISA](https:\u002F\u002Fgithub.com\u002Fdvlab-research\u002FLISA) for providing open-source resources that contributed to the development of this project.\n\n## ⭐️ Citation\n\nIf you find this project useful, welcome to cite us.\n\n```bib\n@article{shen2025vlm,\n  title={Vlm-r1: A stable and generalizable r1-style large vision-language model},\n  author={Shen, Haozhan and Liu, Peng and Li, Jingcheng and Fang, Chunxin and Ma, Yibo and Liao, Jiajia and Shen, Qiaoli and Zhang, Zilun and Zhao, Kangjia and Zhang, Qianqian and Xu, Ruochen and Zhao, Tiancheng },\n  journal={arXiv preprint arXiv:2504.07615},\n  year={2025}\n}\n```\n","# VLM-R1：一款稳定且具有泛化能力的R1风格大型视觉-语言模型\n\n\u003Cfont size=4>\u003Cdiv align='center' > [[🤗 REC演示](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fomlab\u002FVLM-R1-Referral-Expression)] [[🤗 OVD演示](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fomlab\u002FVLM-R1-OVD)] [[🤗 REC数据](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fomlab\u002FVLM-R1)] [[🤗 检查点](https:\u002F\u002Fhuggingface.co\u002Fcollections\u002Fomlab\u002Fvlm-r1-models-67b7352db15c19d57157c348)] [[ModelScope检查点](https:\u002F\u002Fmodelscope.cn\u002Fcollections\u002FOm_AI_Lab\u002FVLM-R1-models)] \u003C\u002Fdiv>\u003C\u002Ffont>\n\n\u003Cfont size=4>\u003Cdiv align='center'>[[📄 技术报告](https:\u002F\u002Farxiv.org\u002Fabs\u002F2504.07615)] [[📝 博客](https:\u002F\u002Fom-ai-lab.github.io\u002Findex.html)]\u003C\u002Fdiv>\u003C\u002Ffont>\n\n\u003Cdiv align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fom-ai-lab_VLM-R1_readme_2d1de61a46cf.png\" width=\"900\"\u002F>\n\u003Cdiv>\n  \u003Cfont size=4>\n    \u003Cp>🎉  \u003Cb>我们的VLM-R1数学模型在Open-Compass数学排行榜上名列前茅（参数量低于40亿），而OVD模型则在OVDEval上取得了当前最优性能。\u003C\u002Fb>\u003C\u002Fp>\n  \u003C\u002Ffont>\n\u003C\u002Fdiv>\n\u003C\u002Fdiv>\n\n自[Deepseek-R1](https:\u002F\u002Fgithub.com\u002Fdeepseek-ai\u002FDeepSeek-R1)发布以来，围绕其复现与改进的工作层出不穷。在本项目中，我们提出了VLM-R1——一个稳定且具备良好泛化能力的R1风格大型视觉-语言模型。\n\n具体而言，在指代表达理解（REC）任务上，我们分别采用R1和SFT两种方式训练了[Qwen2.5-VL](https:\u002F\u002Fgithub.com\u002FQwenLM\u002FQwen2.5-VL)。实验结果表明，在域内测试数据上，当训练步数较少时（100–600步），SFT模型的表现与R1基础模型相差无几；而R1模型则会持续提升性能（如图左所示）。更为重要的是，在域外测试数据上，随着训练步数增加，SFT模型的表现略有下降。相比之下，RL模型却能将其推理能力很好地泛化到域外数据中（如图右所示）。\n\n![image](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fom-ai-lab_VLM-R1_readme_16305e422813.png)\n\\* *我们发现先前的REC SFT实验使用了不匹配的像素配置。因此，我们在更复杂的域外数据上，采用正确的配置重新进行了实验。详细内容请参阅我们的[研究发现](https:\u002F\u002Fom-ai-lab.github.io\u002F2025_03_24.html)。*\n\n## 🚀 特性\n\n本仓库支持以下功能：\n\n- **`GRPO全量微调`**：参见[run_grpo_rec.sh](run_scripts\u002Frun_grpo_rec.sh)\n- **`冻结视觉模块`**：在脚本中将`freeze_vision_modules`设置为`true`。\n- **`GRPO LoRA微调`**：参见[run_grpo_rec_lora.sh](run_scripts\u002Frun_grpo_rec_lora.sh)\n- **`多节点训练`**：参见[multinode_training_demo.sh](run_scripts\u002Fmultinode_training_demo.sh)\n- **`多图像输入训练`**：参见[run_grpo_gui.sh](run_scripts\u002Frun_grpo_gui.sh)\n- **`针对您自己的数据`**：参见[此处](#for-your-own-data)\n- **`多种VLM`**：参见[如何添加新模型](assets\u002Fadd_new_model.md)，目前我们已支持QwenVL和InternVL。\n\n## 🗞️ 更新\n\n- **`2025-08-29`**: 🔥🔥🔥 我们基于京东最新的开源推理框架 `xllm`（GitHub 地址为 [这里](https:\u002F\u002Fgithub.com\u002Fjd-opensource\u002Fxllm)）对 VLM-R1 系列模型进行了进一步优化。与 `vllm-ascend` 相比，TTFT（首个 Token 生成时间）缩短了 50%，整体吞吐量则提升了 127%。更多详情请参阅 [ascend_inference\u002F910B\u002Fxllm\u002FREADME.md](ascend_inference\u002F910B\u002Fxllm\u002FREADME.md)。\n\n- **`2025-08-22`**: 我们使用 vllm-ascend 框架将 VLM-R1 系列模型适配至华为 Ascend Atlas 800T A2 和 Atlas 300I Duo 系列，进一步扩展了该系列模型的部署场景和硬件兼容性。更多详情请参阅 [ascend_inference\u002F910B\u002Fvllm_ascend\u002FREADME.md](ascend_inference\u002F910B\u002Fvllm_ascend\u002FREADME.md) 和 [ascend_inference\u002F300IDuo\u002FREADME.md](ascend_inference\u002F300IDuo\u002FREADME.md)。\n\n- **`2025-06-26`**: 我们为 QwenVL 的边界框引入了后处理缩放操作（训练部分见 [src\u002Fopen-r1-multimodal\u002Fsrc\u002Fopen_r1\u002Fvlm_modules\u002Fqwen_module.py#L124-L129]，评估部分见 [src\u002Feval\u002Ftest_rec_r1.py#L92-L97]），结果略有提升。\n- **`2025-04-16`**: 我们更新了代码库以增强功能并保持实现的一致性。具体而言，REC 流程现已整合至 [grpo_jsonl.py](src\u002Fopen-r1-multimodal\u002Fsrc\u002Fopen_r1\u002Fgrpo_jsonl.py)，以确保各任务间的一致性。此外，我们新增了一个参数 `is_reward_customized_from_vlm_module`，允许使用在 VLM 模块内定义的自定义奖励函数。当该参数设置为 `true` 时，奖励逻辑将由所选模型对应的 [QwenVL2Module](src\u002Fopen-r1-multimodal\u002Fsrc\u002Fopen_r1\u002Fvlm_modules\u002Fqwen_module.py) 或 [InternVLModule](src\u002Fopen-r1-multimodal\u002Fsrc\u002Fopen_r1\u002Fvlm_modules\u002Finternvl_module.py) 处理。同时，训练日志也得到了优化，输出更加详细，便于监控和调试。\n- **`2025-04-11`**: 🔥🔥🔥 我们发布了 VLM-R1 的[技术报告](https:\u002F\u002Farxiv.org\u002Fabs\u002F2504.07615)，总结了我们的主要成果和见解。\n- **`2025-04-03`**: 我们新增了 OVD 任务中使用的 `odLength`、`weighted_sum` 和 `cosine` 奖励。有关奖励的具体用法，请参阅我们的[博客文章](https:\u002F\u002Fom-ai-lab.github.io\u002F2025_03_20.html)和[研究发现](https:\u002F\u002Fom-ai-lab.github.io\u002F2025_03_24.html)，代码实现请参考 [grpo_jsonl.py](src\u002Fopen-r1-multimodal\u002Fsrc\u002Fopen_r1\u002Fgrpo_jsonl.py)。\n- **`2025-03-24`**: 🔥 我们发布了 VLM-R1-OVD 的[研究发现](https:\u002F\u002Fom-ai-lab.github.io\u002F2025_03_24.html)。\n- **`2025-03-23`**: 🔥 我们发布了 VLM-R1-OVD 的[模型权重](https:\u002F\u002Fhuggingface.co\u002Fomlab\u002FVLM-R1-Qwen2.5VL-3B-OVD-0321)和[演示](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fomlab\u002FVLM-R1-OVD)，展示了其在 OVDEval 数据集上的最先进性能。欢迎使用！\n- **`2025-03-20`**: 🔥 我们基于强化学习的模型在 [OVDEval](https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FOVDEval) 上取得了 SOTA 结果，超越了 SFT 基线模型和专门的目标检测模型。有关强化学习如何提升目标检测性能的详细信息，请阅读我们的[博客文章](https:\u002F\u002Fom-ai-lab.github.io\u002F2025_03_20.html)。\n- **`2025-03-17`**: 我们的 VLM-R1 数学模型在 [Open-Compass 数学排行榜](https:\u002F\u002Frank.opencompass.org.cn\u002Fleaderboard-multimodal-reasoning\u002F?m=REALTIME) 中位居前茅（参数量小于 4B）。我们已发布[检查点](https:\u002F\u002Fhuggingface.co\u002Fomlab\u002FVLM-R1-Qwen2.5VL-3B-Math-0305)。\n- **`2025-03-15`**: 我们支持多张图片输入数据。多张图片输入格式请参阅[此处](#for-your-own-data)。我们还提供了一个多张图片脚本示例 [run_grpo_gui.sh](run_scripts\u002Frun_grpo_gui.sh)，详情请见[此处](#for-your-own-data)。\n- **`2025-03-13`**: 我们支持 InternVL 进行 GRPO 任务。详情请参阅 [run_grpo_rec_internvl.sh](run_scripts\u002Frun_grpo_rec_internvl.sh)。InternVL 使用的标注 JSON 文件可在此下载：[rec_jsons_internvl.zip](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fomlab\u002FVLM-R1\u002Fresolve\u002Fmain\u002Frec_jsons_internvl.zip)。如需添加新模型，请参考 [如何添加新模型](assets\u002Fadd_new_model.md)。\n- **`2025-03-02`**: 我们支持 GRPO 的 LoRA 微调。详情请参阅 [run_grpo_rec_lora.sh](run_scripts\u002Frun_grpo_rec_lora.sh)。\n- **`2025-02-27`**: 我们在原始 GRPO 算法中支持 `每批次迭代次数` 和 `裁剪用的 epsilon 值`，通过参数 `--num_iterations` 和 `--epsilon` 实现。\n- **`2025-02-25`**: 我们支持 GRPO 的多节点训练。详情请参阅 [multinode_training_demo.sh](run_scripts\u002Fmultinode_training_demo.sh)。\n- **`2025-02-21`**: 我们发布了 VLM-R1 REC 模型的[检查点](https:\u002F\u002Fhuggingface.co\u002Fomlab\u002FQwen2.5VL-3B-VLM-R1-REC-500steps)。\n- **`2025-02-20`**: 我们发布了[通用数据加载脚本](#for-your-own-data)。\n- **`2025-02-19`**: 我们加入了关于[SFT](#sft)方法的说明。\n- **`2025-02-17`**: 我们在 Hugging Face Spaces 上发布了 VLM-R1 REC 的[演示](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fomlab\u002FVLM-R1-Referral-Expression)。\n- **`2025-02-15`**: 我们发布了 VLM-R1 仓库及[GRPO](#grpo)训练脚本。\n\n## 🤖 模型\n\n- **[`OVD`](https:\u002F\u002Fhuggingface.co\u002Fomlab\u002FVLM-R1-Qwen2.5VL-3B-OVD-0321)**：基于 VLM-R1 训练的开放词汇目标检测（OVD）模型，在 OVDEval 数据集上达到了最先进的性能。\n- **[`Math`](https:\u002F\u002Fhuggingface.co\u002Fomlab\u002FVLM-R1-Qwen2.5VL-3B-Math-0305)**：通过 VLM-R1 训练，我们的数学模型专注于多模态推理任务，并在 OpenCompass 多模态推理排行榜中，参数量小于 4B 的模型中位列第一。\n- **[`REC`](https:\u002F\u002Fhuggingface.co\u002Fomlab\u002FQwen2.5VL-3B-VLM-R1-REC-500steps)**：基于 VLM-R1 训练的指代表达理解（REC）模型，在域外数据及一系列推理-接地任务中表现出色。\n- **[`GUI`](https:\u002F\u002Fhuggingface.co\u002Fkonkazzz\u002FGT-r1)**：基于 VLM-R1 训练的 GUI 缺陷检测模型，其准确率优于基础模型和 SFT 模型，并且在缺陷屏幕和正常屏幕上的泛化能力均有所提升。\n\n| 版本                          | 基础 VLM     | 检查点                                                                                           | 任务类型                 |\n| ------------------------------- | ------------ | ---------------------------------------------------------------------------------------------------- | ------------------------- |\n| VLM-R1-Qwen2.5VL-3B-OVD-0321     | Qwen2.5VL-3B | [omlab\u002FVLM-R1-Qwen2.5VL-3B-OVD-0321](https:\u002F\u002Fhuggingface.co\u002Fomlab\u002FVLM-R1-Qwen2.5VL-3B-OVD-0321)         | 开放词汇目标检测        |\n| VLM-R1-Qwen2.5VL-3B-Math-0305    | Qwen2.5VL-3B | [omlab\u002FVLM-R1-Qwen2.5VL-3B-Math-0305](https:\u002F\u002Fhuggingface.co\u002Fomlab\u002FVLM-R1-Qwen2.5VL-3B-Math-0305)       | 多模态数学              |\n| VLM-R1-Qwen2.5VL-3B-REC-500steps | Qwen2.5VL-3B | [omlab\u002FQwen2.5VL-3B-VLM-R1-REC-500steps](https:\u002F\u002Fhuggingface.co\u002Fomlab\u002FQwen2.5VL-3B-VLM-R1-REC-500steps) | REC\u002F推理-接地            |\n\n## 🎯 待办事项\n\n- [X] 实现多节点训练。\n- [X] 实现 LoRA 微调。\n- [X] 支持更多多模态 LLM。\n- [X] 支持多图像输入。\n- [X] 发布 VLM-R1 数学模型。\n- [X] 发布 VLM-R1 的博客文章。\n- [X] 发布 VLM-R1-OVD 模型。\n- [X] 发布 VLM-R1 的技术报告。\n- [X] 使用 vllm-ascend 框架适配华为昇腾 Atlas 800T A2 和 Atlas 300I Duo 系列。\n- [X] 使用 xllm 框架适配华为昇腾 Atlas 800T A2 系列。\n- [ ] 研究跨任务泛化能力。\n- [ ] 针对其他任务增强 VLM [欢迎提交议题]。\n\n## 🛠️ 设置\n\n```bash\nconda create -n vlm-r1 python=3.10\nconda activate vlm-r1\nbash setup.sh\n```\n\n## 💪🏻 训练\n\n### 引用表达理解 (REC)\n\n#### 📚 GRPO\n\n1. 下载 [COCO Train2014 图片](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fomlab\u002FVLM-R1\u002Fresolve\u002Fmain\u002Ftrain2014.zip) 并解压，将图片目录记为 `\u003Cyour_image_root>`。\n2. 下载 [RefCOCO\u002F+\u002Fg 和 LISA-Grounding 标注文件](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fomlab\u002FVLM-R1\u002Fresolve\u002Fmain\u002Frec_jsons_processed.zip) 并解压（LISA-Grounding 用于域外评估）。\n3. 修改 [run_scripts\u002Frun_grpo_rec.sh](run_scripts\u002Frun_grpo_rec.sh) 文件中的 `data_paths` 和 `image_folders`。\n\n```bash\n# 这些 jsonl 文件包含在步骤 2 的标注文件中。\n# 注意：请使用 jsonl 文件而不是 json 文件。\ndata_paths=\"path\u002Fto\u002Frefcoco_train.jsonl:path\u002Fto\u002Frefcocop_train.jsonl:path\u002Fto\u002Frefcocog_train.jsonl\"\nimage_folders=\"path\u002Fto\u002Fcoco:path\u002Fto\u002Fcoco:path\u002Fto\u002Fcoco\"\n```\n\n4. ``bash run_scripts\u002Frun_grpo_rec.sh``\n\n> [!NOTE]\n> 如果遇到 'CUDA 内存不足' 错误，可以尝试降低 `per_device_train_batch_size`。\n\n\u003Cdiv align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fom-ai-lab_VLM-R1_readme_191f6869692a.jpg\" width=\"750\"\u002F>\n\u003C\u002Fdiv>\n\u003C!-- ![image](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fom-ai-lab_VLM-R1_readme_b6e6c5c7959b.jpg) -->\n\n#### 📚 多节点 GRPO\n\n对于多节点训练，请参考 [multinode_training_demo.sh](src\u002Fopen-r1-multimodal\u002Fmultinode_training_demo.sh)。\n\n#### 📚 SFT\n\n我们使用 [LLaMA-Factory](https:\u002F\u002Fgithub.com\u002Fhiyouga\u002FLLaMA-Factory) 来训练 SFT 模型。\n\n1. 克隆 [LLaMA-Factory](https:\u002F\u002Fgithub.com\u002Fhiyouga\u002FLLaMA-Factory) 仓库并安装依赖。\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fhiyouga\u002FLLaMA-Factory.git\ncd LLaMA-Factory\npip install -e \".[torch,metrics]\"\n```\n\n2. 下载我们提供的 dataset_info.json、mllm_rec_json.json 和 qwen2_5_vl_full_sft.yaml [这里](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fomlab\u002FVLM-R1\u002Ftree\u002Fmain\u002Fsft_related)。将 json 文件放入 `LLaMA-Factory\u002Fdata` 目录，yaml 文件放入 `LLaMA-Factory\u002Fexamples\u002Ftrain_full` 目录。\n3. 运行以下命令来训练 SFT 模型。\n\n```bash\nllamafactory-cli train examples\u002Ftrain_full\u002Fqwen2_5_vl_full_sft.yaml\n```\n\n### 针对您自己的数据\n\n\u003Cdiv style=\"text-align: justify;\">\n\n我们支持加载这种格式的 jsonl 数据，具体实现见 [`src\u002Fopen-r1-multimodal\u002Fsrc\u002Fopen_r1\u002Fgrpo_jsonl.py`](src\u002Fopen-r1-multimodal\u002Fsrc\u002Fopen_r1\u002Fgrpo_jsonl.py)。请注意，针对您的特定任务，可能需要使用不同的奖励函数。欢迎提交 PR 添加您自己的奖励函数，或分享任何其他有趣的发现！\n\n\u003C\u002Fdiv>\n\njsonl 的格式如下：\n\n```json\n{\n  \"id\": 1,\n  \"image\": \"Clevr_CoGenT_TrainA_R1\u002Fdata\u002Fimages\u002FCLEVR_trainA_000001_16885.png\",\n  \"conversations\": [\n    {\"from\": \"human\", \"value\": \"\u003Cimage>有多少个紫色金属球？\"},\n    {\"from\": \"gpt\", \"value\": \"0\"}\n  ]\n}\n```\n\n如果您希望使用多图像输入，可以采用以下格式：\n\n```json\n{\n  \"id\": 1,\n  \"image\": [\"Clevr_CoGenT_TrainA_R1\u002Fdata\u002Fimages\u002FCLEVR_trainA_000001_16885.png\", \"Clevr_CoGenT_TrainA_R1\u002Fdata\u002Fimages\u002FCLEVR_trainA_000001_16886.png\"],\n  \"conversations\": [\n    {\"from\": \"human\", \"value\": \"\u003Cimage>\u003Cimage>这两张图中共有多少个紫色金属球？\"},\n    {\"from\": \"gpt\", \"value\": \"3\"}\n  ]\n}\n```\n\n> [!NOTE]\n> jsonl 文件中的图片路径应相对于 `--image_folders` 中指定的图片文件夹。输入图片的绝对路径由 `os.path.join(image_folder, data['image'])` 构建。例如：\n\n- 如果您的 jsonl 中有 `\"image\": \"folder1\u002Fimage1.jpg\"`\n- 而您指定了 `--image_folders \"\u002Fpath\u002Fto\u002Fimages\u002F\"`\n- 则完整的图片路径将是 `\u002Fpath\u002Fto\u002Fimages\u002Ffolder1\u002Fimage1.jpg`\n\n可以通过 `:` 分隔符指定多个数据文件和图片文件夹：\n\n```bash\n--data_file_paths \u002Fpath\u002Fto\u002Fdata1.jsonl:\u002Fpath\u002Fto\u002Fdata2.jsonl \\\n--image_folders \u002Fpath\u002Fto\u002Fimages1\u002F:\u002Fpath\u002Fto\u002Fimages2\u002F\n```\n\n脚本可以这样运行：\n\n```bash\n# 可以参考 run_grpo_rec.sh 作为示例\ntorchrun --nproc_per_node=\"8\" \\\n    --nnodes=\"1\" \\\n    --node_rank=\"0\" \\\n    --master_addr=\"127.0.0.1\" \\\n    --master_port=\"12345\" \\\n  src\u002Fopen_r1\u002Fgrpo_jsonl.py \\\n    --output_dir output\u002F$RUN_NAME \\\n    --model_name_or_path Qwen\u002FQwen2.5-VL-3B-Instruct \\\n    --deepspeed ${REPO_HOME}\u002Fsrc\u002Fopen-r1-multimodal\u002Flocal_scripts\u002Fzero3.json \\\n    --data_file_paths \u002Fpath\u002Fto\u002Fyour\u002Fdata.jsonl \\ # 可以是多个，用\":\"分隔\n    --image_folders \u002Fpath\u002Fto\u002Fyour\u002Fimage\u002Ffolder \\ # 可以是多个，用\":\"分隔\n    ...\n```\n\n\u003Cdiv style=\"text-align: justify;\">\n\n### 多图像输入\n我们提供了一个多图像脚本的示例 [run_grpo_gui.sh](src\u002Fopen-r1-multimodal\u002Frun_scripts\u002Frun_grpo_gui.sh)。这项任务要求模型分析用户操作前后拍摄的两张 GUI 截图，以判断是否存在 UI 交互缺陷，该数据来自 [GUI-Testing-Arena](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fsongjah\u002FGTArena-UI-Defects)。下载 [图片](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fomlab\u002FVLM-R1\u002Fresolve\u002Fmain\u002Fgui_multi-image.zip) 并解压到 `\u002Fpath\u002Fto\u002Fimages\u002F`。然后修改脚本中的 `image_folders` 参数并运行。\n\n```bash\nbash run_scripts\u002Frun_grpo_gui.sh\n```\n\n\u003C\u002Fdiv>\n\n## 📊 评估\n\n![image](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fom-ai-lab_VLM-R1_readme_aa7d12895ce0.png)\n\n1. 下载提供的 [LISA-Grounding 图片](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fomlab\u002FVLM-R1\u002Fresolve\u002Fmain\u002Flisa-test.zip)。\n\n```bash\ncd .\u002Fsrc\u002Feval\n\n# 请记得在脚本中更改模型路径、图片根目录和标注路径\ntorchrun --nproc_per_node=X test_rec_r1.py # 对于 GRPO。'X' 是您拥有的 GPU 数量。\ntorchrun --nproc_per_node=X test_rec_baseline.py # 对于 SFT。\n```\n\n## 🔍 昇腾推理\n\n我们已使用 vllm-ascend 框架将 VLM-R1 系列模型适配到华为昇腾 Atlas 800T A2 和 Atlas 300I Duo 系列。具体的适配和推理如下：\n\n- **Atlas 800T A2**: 请参考 [ascend_inference\u002F910B\u002Fvllm_ascend\u002FREADME.md](ascend_inference\u002F910B\u002Fvllm_ascend\u002FREADME.md)\n- **Atlas 300I Duo**: 请参考 [ascend_inference\u002F300IDuo\u002FREADME.md](ascend_inference\u002F300IDuo\u002FREADME.md)\n\n## 🤝 致谢\n\n我们谨向以下开源项目及团队致以诚挚的感谢：[DeepSeek](https:\u002F\u002Fgithub.com\u002Fdeepseek-ai\u002FDeepSeek-R1)、[Open-R1](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Fopen-r1)、[QwenVL](https:\u002F\u002Fgithub.com\u002FQwenLM\u002FQwen2.5-VL)、[Open-R1-Multimodal](https:\u002F\u002Fgithub.com\u002FEvolvingLMMs-Lab\u002Fopen-r1-multimodal)、[R1-V](https:\u002F\u002Fgithub.com\u002FDeep-Agent\u002FR1-V)、[RefCOCO](https:\u002F\u002Fgithub.com\u002Flichengunc\u002Frefer)、[RefGTA](https:\u002F\u002Fgithub.com\u002Fmikittt\u002Feasy-to-understand-REG\u002Ftree\u002Fmaster\u002Fpyutils\u002Frefer2)、[LLaMA-Factory](https:\u002F\u002Fgithub.com\u002Fhiyouga\u002FLLaMA-Factory)、[OVDEval](https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FOVDEval)、[GUI-Testing-Arena](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fsongjah\u002FGTArena-UI-Defects)以及[LISA](https:\u002F\u002Fgithub.com\u002Fdvlab-research\u002FLISA)，感谢他们提供的开源资源，这些资源对本项目的开发起到了重要推动作用。\n\n## ⭐️ 引用\n\n如果您认为本项目对您有所帮助，欢迎引用我们的工作。\n\n```bibtex\n@article{shen2025vlm,\n  title={Vlm-r1: 一种稳定且具有泛化能力的 R1 风格大型视觉语言模型},\n  author={Shen, Haozhan and Liu, Peng and Li, Jingcheng and Fang, Chunxin and Ma, Yibo and Liao, Jiajia and Shen, Qiaoli and Zhang, Zilun and Zhao, Kangjia and Zhang, Qianqian and Xu, Ruochen and Zhao, Tiancheng },\n  journal={arXiv preprint arXiv:2504.07615},\n  year={2025}\n}\n```","# VLM-R1 快速上手指南\n\nVLM-R1 是一个稳定且具备强泛化能力的 R1 风格大型视觉 - 语言模型（Large Vision-Language Model）。该项目基于 Qwen2.5-VL 和 InternVL 等基座模型，通过 GRPO（强化学习）方法在指代性表达理解（REC）、开放词汇检测（OVD）及多模态数学推理等任务上取得了 SOTA 性能。\n\n## 环境准备\n\n### 系统要求\n- **操作系统**: Linux (推荐 Ubuntu 20.04+)\n- **Python 版本**: 3.10\n- **GPU**: 支持 CUDA 的 NVIDIA GPU 或 华为昇腾 (Ascend) 系列 (如 Atlas 800T A2, 300I Duo)\n- **显存建议**: 根据模型大小和 Batch Size 调整，建议使用多卡或多节点训练以获得最佳效果。\n\n### 前置依赖\n确保已安装 `conda` 和 `git`。\n\n## 安装步骤\n\n1. **创建并激活虚拟环境**\n   ```bash\n   conda create -n vlm-r1 python=3.10\n   conda activate vlm-r1\n   ```\n\n2. **克隆代码库并安装依赖**\n   ```bash\n   git clone https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1.git\n   cd VLM-R1\n   bash setup.sh\n   ```\n   > **提示**: `setup.sh` 会自动安装项目所需的 Python 依赖包。如果下载速度较慢，可手动修改 `pip` 源为国内镜像（如清华源或阿里源）。\n\n## 基本使用\n\n以下以 **指代性表达理解 (REC)** 任务的 GRPO 训练为例，展示最简使用流程。\n\n### 1. 数据准备\n下载训练图像和标注文件：\n- **图像**: [COCO Train2014](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fomlab\u002FVLM-R1\u002Fresolve\u002Fmain\u002Ftrain2014.zip)\n- **标注**: [RefCOCO\u002F+\u002Fg 和 LISA-Grounding](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002Fomlab\u002FVLM-R1\u002Fresolve\u002Fmain\u002Frec_jsons_processed.zip)\n\n解压后，假设图像根目录为 `\u003Cyour_image_root>`，标注文件位于本地路径。\n\n### 2. 配置训练脚本\n编辑 `run_scripts\u002Frun_grpo_rec.sh` 文件，修改数据路径参数：\n\n```bash\n# 注意：请使用 jsonl 格式的文件，多个路径用冒号分隔\ndata_paths=\"path\u002Fto\u002Frefcoco_train.jsonl:path\u002Fto\u002Frefcocop_train.jsonl:path\u002Fto\u002Frefcocog_train.jsonl\"\nimage_folders=\"path\u002Fto\u002Fcoco:path\u002Fto\u002Fcoco:path\u002Fto\u002Fcoco\"\n```\n\n### 3. 启动训练\n运行脚本开始训练：\n```bash\nbash run_scripts\u002Frun_grpo_rec.sh\n```\n\n> **注意**: 如果遇到 `CUDA out of memory` 错误，请在脚本中减小 `per_device_train_batch_size` 参数。\n\n### 其他训练模式\n项目还支持多种高级训练配置，只需替换对应的脚本即可：\n- **LoRA 微调**: `bash run_scripts\u002Frun_grpo_rec_lora.sh`\n- **多图像输入训练**: `bash run_scripts\u002Frun_grpo_gui.sh`\n- **多节点分布式训练**: `bash run_scripts\u002Fmultinode_training_demo.sh`\n- **InternVL 模型支持**: `bash run_scripts\u002Frun_grpo_rec_internvl.sh`\n\n### 推理与演示\n训练完成后，可加载 Hugging Face 上的预训练权重进行推理，或直接体验在线 Demo：\n- **REC Demo**: [Hugging Face Spaces](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fomlab\u002FVLM-R1-Referral-Expression)\n- **OVD Demo**: [Hugging Face Spaces](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fomlab\u002FVLM-R1-OVD)\n- **模型权重**: [Hugging Face Collections](https:\u002F\u002Fhuggingface.co\u002Fcollections\u002Fomlab\u002Fvlm-r1-models-67b7352db15c19d57157c348) 或 [ModelScope](https:\u002F\u002Fmodelscope.cn\u002Fcollections\u002FOm_AI_Lab\u002FVLM-R1-models)","某电商平台的智能客服团队正致力于升级系统，使其能精准理解用户发送的商品截图并定位具体瑕疵部位。\n\n### 没有 VLM-R1 时\n- **泛化能力弱**：传统监督微调（SFT）模型在训练数据覆盖的常见商品上表现尚可，但一旦遇到未见过的新品类或复杂背景，识别准确率急剧下降。\n- **推理逻辑缺失**：模型仅能机械匹配像素特征，无法像人类一样通过“推理”排除干扰项，常将阴影误判为污渍或将标签误认为破损。\n- **迭代成本高**：为了提升对新场景的适应性，团队不得不持续收集海量标注数据进行重复训练，但效果往往陷入瓶颈甚至出现倒退。\n\n### 使用 VLM-R1 后\n- **跨域泛化强**：得益于强化学习（RL）带来的推理能力，VLM-R1 在面对从未见过的户外装备或特殊材质时，仍能稳定输出精准的边界框坐标。\n- **思维链推导**：模型具备类似 DeepSeek-R1 的思考过程，能逐步分析图像细节（如“先排除反光，再确认纹理断裂”），显著降低误报率。\n- **训练效率优**：仅需少量步骤训练，VLM-R1 即可在域外数据上实现性能稳步提升，无需依赖大规模数据堆砌，大幅缩短了新业务上线周期。\n\nVLM-R1 通过引入强化学习机制，让视觉语言模型从“死记硬背”进化为“学会推理”，彻底解决了复杂视觉场景下的泛化难题。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fom-ai-lab_VLM-R1_16305e42.png","om-ai-lab","Om AI Lab","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fom-ai-lab_520db257.jpg","Open Multimodal AGI Research ",null,"OmAI_lab","https:\u002F\u002Fgithub.com\u002Fom-ai-lab",[80,84,88,92],{"name":81,"color":82,"percentage":83},"Python","#3572A5",89.4,{"name":85,"color":86,"percentage":87},"Shell","#89e051",10.2,{"name":89,"color":90,"percentage":91},"Dockerfile","#384d54",0.3,{"name":93,"color":94,"percentage":95},"Makefile","#427819",0.1,5926,378,"2026-04-06T12:05:35","Apache-2.0",4,"Linux","必需。支持 NVIDIA GPU（需处理 CUDA OOM 错误，暗示显存需求较高）或华为昇腾 Ascend Atlas 800T A2 \u002F Atlas 300I Duo。具体显存大小未说明，但支持多节点训练以应对资源需求。","未说明",{"notes":105,"python":106,"dependencies":107},"1. 建议使用 conda 创建名为 'vlm-r1' 的虚拟环境并运行 setup.sh 进行安装。\n2. 支持多种训练模式：全量微调、冻结视觉模块、LoRA 微调、多节点训练及多图像输入。\n3. 若遇到 'CUDA out of memory' 错误，需减小 'per_device_train_batch_size' 参数。\n4. 已适配华为昇腾硬件生态，可使用 xllm 或 vllm-ascend 框架进行推理加速。","3.10",[108,109,110],"xllm (可选，用于昇腾推理优化)","vllm-ascend (可选，用于昇腾部署)","LLaMA-Factory (用于 SFT 训练)",[14,112,35],"其他",[114,115,116,117,118,119,120,121,122,123],"deepseek-r1","grpo","llm","multimodal","vlm","qwen","vlm-r1","multimodal-r1","r1-zero","reinforcement-learning","2026-03-27T02:49:30.150509","2026-04-11T16:51:23.173851",[127,132,137,142,147,151],{"id":128,"question_zh":129,"answer_zh":130,"source_url":131},22484,"为什么 IoU 奖励（iou_reward）总是为零或非常小？","这通常与图像处理器配置有关。建议检查并修改模型路径下的 `preprocessor_config.json` 文件，将 `image_processor_type` 设置为 `Qwen2VLImageProcessor`。如果未下载模型文件，可以尝试通过参数或其他方式进行修改。此外，该问题也可能与采样策略或批次计算方式有关，建议参考社区讨论进一步排查。","https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fissues\u002F44",{"id":133,"question_zh":134,"answer_zh":135,"source_url":136},22485,"如何实现 LoRA 微调训练？","项目最新版本已支持 LoRA 训练。用户只需更新到最新代码版本即可直接使用 LoRA 进行微调。在训练日志中确认使用了 GRPO+LoRA 组合，随着训练步数增加，Loss 会发生变化但可能保持较小数值，这是正常现象。","https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fissues\u002F26",{"id":138,"question_zh":139,"answer_zh":140,"source_url":141},22486,"基线模型 Qwen2.5-VL-Instruct 在 RefCOCO 等数据集上达到 73.7% 准确率所使用的 Prompt 是什么？","官方基线测试脚本 `test_rec_baseline.py` 中使用了特定的 Prompt 逻辑。如果直接使用默认 Prompt 可能导致模型输出归一化坐标（比值）而非绝对像素坐标，从而降低准确率。建议使用如下格式的 Prompt：\"{Question}. Output the answer in pixel coordinates in the format of [x1, y1, x2, y2]. Minimum value is 0 and maximum value is the width\u002Fheight of the image. Output the answer in JSON format.\" 这样可以显著提升准确率至 80% 以上。具体实现可参考 `src\u002Feval\u002Ftest_rec_baseline.py` 中的代码逻辑。","https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fissues\u002F6",{"id":143,"question_zh":144,"answer_zh":145,"source_url":146},22487,"GRPO 训练过程中出现 NCCL 通信超时（Watchdog caught collective operation timeout）如何解决？","该问题通常由多卡通信阻塞引起。建议在启动脚本中设置以下环境变量来延长超时时间并禁用部分 NCCL 特性：\nexport NCCL_P2P_DISABLE=1\nexport NCCL_BLOCKING_WAIT=1\nexport NCCL_ASYNC_ERROR_HANDLING=1\nexport NCCL_IB_DISABLE=1\nexport NCCL_TIMEOUT=3600\nexport TORCH_NCCL_TRACE_BUFFER_SIZE=1024\nexport NCCL_P2P_LEVEL=NVL\n同时在 torchrun 命令中添加 `--watchdog-timeout 3600` 参数。若使用 A100\u002FA6000 混合环境，还需确保所有显卡驱动和 CUDA 版本一致。","https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fissues\u002F109",{"id":148,"question_zh":149,"answer_zh":150,"source_url":146},22488,"使用 PeftModel 进行训练时出现 'No label_names provided' 警告如何处理？","这是因为 `PeftModelForCausalLM` 隐藏了基础模型的输入参数，导致 Trainer 无法自动推断 label_names。虽然警告提示空列表将被使用，通常不影响训练，但若需消除警告，可在初始化 Trainer 时显式传入 `label_names=[]` 参数，或者检查数据加载器是否正确提供了标签字段。",{"id":152,"question_zh":153,"answer_zh":154,"source_url":141},22489,"如何获取用于 REC（Referencing Expression Comprehension）任务的具体评估代码和 Prompt 实现？","可以参考项目中的 `src\u002Feval\u002Ftest_rec_baseline.py` 文件。该文件包含了完整的评估流程，包括数据加载、Prompt 构建、模型推理及结果解析。关键配置包括：\n- 模型路径：`MODEL_PATH = \"\u002Fpath\u002Fto\u002FQwen2.5-VL-3B-Instruct\"`\n- 数据集列表：`TEST_DATASETS = ['refcoco_val', 'refcocop_val', 'refcocog_val']`\n- 图像根目录和数据根目录需根据实际路径修改。\nPrompt 构建部分强制模型输出 JSON 格式的像素坐标 [x1, y1, x2, y2]，以确保与评估指标兼容。",[156,161,166],{"id":157,"version":158,"summary_zh":159,"released_at":160},136206,"v0.2.1","## 变更内容\n* Develop\u002Fv0.2.0 由 @SZhanZ 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F177 中完成\n* Develop\u002Fv0.2.0 由 @SZhanZ 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F186 中完成\n* Develop\u002Fv0.2.0 由 @SZhanZ 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F187 中完成\n* Develop\u002Fv0.2.0 由 @SZhanZ 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F188 中完成\n* 更新 README 由 @SZhanZ 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F189 中完成\n* 在 README 中添加发现信息 由 @SZhanZ 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F190 中完成\n* 修复选择题奖励 由 @Amos1109 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F144 中完成\n* 功能：Clip Higher 由 @SabaPivot 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F199 中完成\n* Feature\u002Fv0.2.1\u002FodLength_reward 由 @P3ngLiu 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F207 中完成\n* 同步至 main 分支 由 @SZhanZ 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F208 中完成\n* 为 Develop\u002Fv0.2.1 添加更多奖励 由 @zhangqianqianhzlh 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F209 中完成\n* Develop\u002Fv0.2.1 由 @SZhanZ 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F216 中完成\n* 修复 processing_class 错误 由 @SZhanZ 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F223 中完成\n* 发布技术报告 由 @SZhanZ 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F228 中完成\n* 更新 bibtex 由 @SZhanZ 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F230 中完成\n* 添加 zero2 json 文件 由 @SZhanZ 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F231 中完成\n\n## 新贡献者\n* @SabaPivot 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F199 中完成了首次贡献\n* @P3ngLiu 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F207 中完成了首次贡献\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fcompare\u002Fv0.2.0...v0.2.1","2025-04-15T06:09:05",{"id":162,"version":163,"summary_zh":164,"released_at":165},136207,"v0.2.0","## 变更内容\n* @KingSan666888 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F157 中添加了 test_od_r1\n* @SZhanZ 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F165 中开发 v0.2.0 版本\n* @SZhanZ 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F166 中在 README 中添加了数学模型\n* @SZhanZ 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F170 中在 README 中添加了功能介绍\n* @SZhanZ 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F176 中同步了博客内容\n\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fcompare\u002Fv0.1.0...v0.2.0","2025-03-24T11:50:54",{"id":167,"version":168,"summary_zh":169,"released_at":170},136208,"v0.1.0","## 变更内容\n* Ruox\u002Fmain jsonl 数据加载器，由 @xrc10 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F14 中实现\n* 文档：更新 README.md，由 @eltociear 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F27 中完成\n* 修复模型的 torch_dtype 设置，由 @zhangqianqianhzlh 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F49 中完成\n* 自定义奖励函数，由 @zhangqianqianhzlh 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F55 中实现\n* 多节点 GRPO 配方，由 @xrc10 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F59 中实现\n* 为 GRPO 添加 epsilon 截断，由 @xrc10 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F61 中完成\n* 格式不唯一，由 @Amos1109 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F65 中提出\n* 添加来自原始 GRPO 算法的 num_iterations 参数，由 @xrc10 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F78 中完成\n* 更新 grpo_trainer.py，由 @davidluciolu 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F58 中完成\n* 添加 yes_no_reward 函数，由 @KingSan666888 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F88 中实现\n* 修复默认奖励方法，由 @zhangqianqianhzlh 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F87 中完成\n* 修复多匹配情况，由 @zhangqianqianhzlh 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F94 中完成\n* 转换其他类型的答案，由 @xrc10 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F95 中完成\n* 修复数据加载器和批处理，由 @xrc10 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F98 中完成\n* 修复：将 transformers 固定到 v4.49.0 版本，以解决模型加载问题，由 @chaoyuhao 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F105 中完成\n* LLM 奖励函数，由 @Amos1109 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F115 中实现\n* 数学奖励函数，由 @Amos1109 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F127 中实现\n* 支持语言训练数据，由 @zhangqianqianhzlh 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F130 中实现\n\n## 新贡献者\n* @xrc10 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F14 中完成了首次贡献\n* @eltociear 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F27 中完成了首次贡献\n* @zhangqianqianhzlh 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F49 中完成了首次贡献\n* @Amos1109 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F65 中完成了首次贡献\n* @davidluciolu 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F58 中完成了首次贡献\n* @chaoyuhao 在 https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fpull\u002F105 中完成了首次贡献\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002Fom-ai-lab\u002FVLM-R1\u002Fcommits\u002Fv0.1.0","2025-03-17T08:16:29"]