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 ~

相关推荐
名字不好奇3 小时前
多模态大模型原理:一切皆向量,一切皆可生成
llm·transformer
Artech4 小时前
[MAF的Agent管道详解-03]连接LLM的IChatClient对象
ai·llm·openai·agent·maf·agent管道·ichatclient
leo03085 小时前
三种 Norm 一张图读懂:LayerNorm、RMSNorm、AdaRMS
人工智能·llm
wangruofeng5 小时前
DeepSeek 和小米都在降价,为什么公司反而快烧不起 Token 了?
llm·deepseek
爱听歌的周童鞋6 小时前
Learn-Claude-Code | 笔记 | Tools & Execution | s03_new Permission
llm·agent·tools·permission·execution·claude code
带娃的IT创业者6 小时前
开源语音AI的边界:从 `luongnv89/claude-howto` 看前沿技术的落地实践
人工智能·开源·llm·大语言模型·claude·语音交互·语音ai
Highcharts.js7 小时前
|Highcharts图表专家智能体+Highcharts GPT +MCP 服务=智能图表开发服务体系
gpt·信息可视化·llm·图表·智能体·highcharts·图表开发
XLYcmy7 小时前
Agent身份与权限系统设计方案
windows·网络安全·ai·llm·飞书·api·agent
养肥胖虎15 小时前
完整学习LLM(六):上下文窗口是什么,为什么模型会忘东西
llm·上下文窗口·contextwindow
Terrence Shen16 小时前
Hermes agent的tools是怎么落地应用的系列
人工智能·llm·agent·hermes