# OpenVLA 4-bit量化报错.to不支持bitsandbytes模型

> 原文链接：https://robotics.hellobike.com/pitfalls/2026-10-17-openvla-287
> 频道：pitfalls | 更新日期：2026-10-17 | 标签：auto, github-issue, openvla
> 核心摘要：因accelerate≥1.2.0与transformers 4.40.1兼容性缺陷导致4-bit加载失败，降级accelerate或修复代码可解。

# OpenVLA 4-bit量化报错.to不支持bitsandbytes模型

::: v-pre
> 本文由 AI 根据公开内容整理，可能有误，请以原文为准：[ValueError when using 4-bit quantization - (.to) is not supported for 4-bit bitsandbytes models](https://github.com/openvla/openvla/issues/287)（GitHub openvla/openvla #287）

**状态**：已解决

## 问题

在LIBERO评测中启用`--load_in_4bit True`加载OpenVLA时，`dispatch_model`内部调用`.to()`触发`ValueError: .to is not supported for 4-bit or 8-bit bitsandbytes models`。

## 环境

Python 3.9.23, CUDA 12.6, PyTorch 2.7.1+cu126, transformers 4.40.1, bitsandbytes 0.46.1, accelerate ≥1.2.0 (pyproject.

## 解决办法

1. 将accelerate版本降级至0.26.0或≤1.1.x（如`pip install accelerate==0.26.0`），规避新版dispatch逻辑缺陷。
2. 或在`pyproject.toml`中添加依赖约束`accelerate<1.2.0`，防止新环境自动安装不兼容版本。
3. 若需保留高版本accelerate，需修改`experiments/robot/openvla_utils.py`中`get_vla()`函数，确保加载时显式传入`device_map="auto"`并避免后续手动调用`.to()`。
4. 参考PR #351合入fail-fast运行时检查与回归测试，确保环境配置正确性。

讨论原作者：@jjjenghi 等，版权归原作者所有。
:::

## 原始参考来源 (Sources)

- [GitHub openvla/openvla #287：ValueError when using 4-bit quantization - (.to) is not supported for 4-bit bitsandbytes models](https://github.com/openvla/openvla/issues/287)