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 ~

相关推荐
DO_Community18 小时前
RAG 的 Embedding 模型需要微调吗?什么时候值得自己训练?
人工智能·llm·aigc·agent·ai编程
武子康19 小时前
小智的音频队列满了:丢旧帧、拒新包与播放延迟
人工智能·llm·agent
AI技术新视界19 小时前
哪些推理框架支持 N‑Gram Engram 表offload(卸载)到SSD
llm·推理框架·engram
武子康19 小时前
SGLang 回答慢,时间究竟花在了哪里?
人工智能·llm·agent
2601_9622974820 小时前
基于LangChain+LLM大模型+机器学习的恶意域名(流量)智能检测系统
机器学习·langchain·llm·恶意域名·流量检测
流浪00120 小时前
大模型技术全景(八):MCP,大模型的“万能插头“——一次集成处处运行
llm
AINative软件工程21 小时前
LLM 应用的测试替身工程实践:用 Fake/Stub/Mock 让 AI 代码真正跑起来 CI
单元测试·llm·ai编程
武子康1 天前
小智的 MQTT 已连接,为什么还不能说话?从音频通道看协议选择
人工智能·llm·agent
tachibana22 天前
什么是 Function Calling ?
数据库·人工智能·ai·llm·agent
武子康2 天前
让 SGLang 按 JSON 回答,怎样少写一些补救代码
人工智能·llm·agent