Rex-Omni 开始

Rex-Omni 是一个 3B 参数多模态模型,它将视觉感知任务统一到一个"下一点预测"框架中。

其支持的任务有:物体检测、OCR、指向、关键点定位、视觉提示。

官方 README 有详细说明,包括各任务的示例。以下是个人的实践手记 ✌️

环境

准备 Conda 环境,

bash 复制代码
conda create -n rexomni python=3.10 -y
conda activate rexomni

# Install PyTorch (CPU version)
pip install torch torchvision
# Install PyTorch with CUDA (version <= nvidia-smi shown)
#  https://pytorch.org/get-started/locally
pip install torch==2.7.0 torchvision --index-url https://download.pytorch.org/whl/cu128

准备 Rex-Omni,

bash 复制代码
git clone --depth 1 https://github.com/IDEA-Research/Rex-Omni.git
cd Rex-Omni
pip install -r requirements.txt
pip install -v -e .

如遇 flash-attn 安装错误,

bash 复制代码
# 直接安装预编译的 flash-attn
wget https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.4.post1/flash_attn-2.7.4.post1+cu12torch2.7cxx11abiTRUE-cp310-cp310-linux_x86_64.whl
pip install ./flash_attn-*.whl

# 或编译安装 flash-attn
#  https://github.com/dao-ailab/flash-attention
conda install -c nvidia cuda=12.8
# pip install -U pip setuptools
pip install packaging psutil ninja
MAX_JOBS=4 pip install flash-attn --no-build-isolation

# 检查 flash-attn 版本(注意版本要求)
#  Rex-Omni: flash-attn==2.7.4.post1
#  xformers: flash-attn>=2.7.1,<=2.7.4
python -c "import flash_attn; print(flash_attn.__version__)"

推理

bash 复制代码
# Use model: Rex-Omni-AWQ, not Rex-Omni
#  vLLM params adjusted to reduce HBM usage
HF_ENDPOINT=https://hf-mirror.com python practice/Rex-Omni/infer_awq.py
# HF_ENDPOINT=https://hf-mirror.com python practice/Rex-Omni/infer.py

# Notice:
#  Cannot use FlashAttention-2 backend for Volta and Turing GPUs

代码,

结果,

训练

结语

Let's Go Coding ~

相关推荐
Michaelliu_dev11 小时前
多模态大模型推理流程解析
人工智能·llm·多模态大模型·vit·llava·rope·mllm
玉鸯12 小时前
Agent 的任务编排:从 System Prompt 到 Hierarchical Multi-Agent
python·llm·agent
土豆125015 小时前
DeepSeek V4-Flash 正式版深度解读:一行 changelog 里的暗涌与野心
人工智能·llm
Michaelliu_dev15 小时前
RoPE通俗讲解
人工智能·llm·位置编码·多模态大模型·rope·旋转位置编码·mllm
To_OC1 天前
从 0 到 1:Milvus + 大模型打造私人记忆知识库
人工智能·node.js·llm
孙启超1 天前
【AI应用开发】 RAG篇(四):Prompt 工程与进阶技术
人工智能·llm·embedding·rag·向量化·chunking·文档切分
周末程序猿1 天前
图解 120 个大语言模型(LLM)核心概念(91-120)
llm·agent
众人皆醒我独醉1 天前
TGI:HuggingFace 的官方推理服务——不止 PagedAttention,更懂模型生态
面试·llm·ai编程
众人皆醒我独醉1 天前
vLLM:PagedAttention 如何让 LLM 推理吞吐提升 24 倍
面试·llm·ai编程
张彦峰ZYF1 天前
全球开源大模型生态-从开放权重到开放智能系统:发展、进展、主力模型成就与方向分析
人工智能·开源·llm·agent