当前位置: 首页 > news >正文

下载安装运行测试开源vision-language-action(VLA)模型OpenVLA

1. 安装

项目官网OpenVLA
模型

首先按照官网提示的以下代码,执行创建环境->安装最小依赖->git克隆项目等

# Create and activate conda environment
conda create -n openvla python=3.10 -y
conda activate openvla# Install PyTorch. Below is a sample command to do this, but you should check the following link
# to find installation instructions that are specific to your compute platform:
# https://pytorch.org/get-started/locally/
conda install pytorch torchvision torchaudio pytorch-cuda=12.4 -c pytorch -c nvidia -y  # UPDATE ME!# Clone and install the openvla repo
git clone https://github.com/openvla/openvla.git
cd openvla
pip install -e .# Install Flash Attention 2 for training (https://github.com/Dao-AILab/flash-attention)
#   =>> If you run into difficulty, try `pip cache remove flash_attn` first
pip install packaging ninja
ninja --version; echo $?  # Verify Ninja --> should return exit code "0"
pip install "flash-attn==2.5.5" --no-build-isolation

下载openvla-7b模型到本地

hugging face镜像网站https://hf-mirror.com上下载
我用的是AutoDL,所以想直接把模型下载到远程的服务器上,操作如下。
(1)安装工具huggingface-cli

pip install -U huggingface_hub

(2)创建python脚本

import os
// 设置环境变量
os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com'
// 下载模型
os.system('huggingface-cli download --resume-download HF上的模型名称 --local-dir 本地存放路径')
// 下载数据集
os.system('huggingface-cli download --repo-type dataset --resume-download HF上的数据集名称 --local-dir 本地存放路径')

例如,我只想下载openvla-7b这个模型,脚本如下

import os
# // 设置环境变量
os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com'
# // 下载模型
os.system('huggingface-cli download --resume-download openvla/openvla-7b --local-dir /root/openvla/openvla7b')

执行上述脚本即可下载模型到本地,即时镜像也需要挺长时间。
在运行过程中,出现磁盘空间不够的问题导致下载终止!需要注意autodl中租用的实例中会自动分配30G系统盘+50G数据盘,如下图。其中/root/autodl-tmp为数据盘,除此之外的都认为是系统盘,一般创建的环境可以默认在系统盘,但是项目源码特别是模型(通常几十个G)在下载存放时要注意路径,如果不小心将模型放到系统盘(容量非常小,只有30G),很可能导致下载终止浪费掉几个小时时间!
手动删除系统盘的模型文件后,最后再清理一下磁盘AutoDL清理磁盘
在这里插入图片描述

2. 在BridgeData上微调OpenVLA

首先下载数据集,使用一下命令下载

# Change directory to your base datasets folder
cd <PATH TO BASE DATASETS DIR># Download the full dataset (124 GB)
wget -r -nH --cut-dirs=4 --reject="index.html*" https://rail.eecs.berkeley.edu/datasets/bridge_release/data/tfds/bridge_dataset/# Rename the dataset to `bridge_orig` (NOTE: Omitting this step may lead to runtime errors later)
mv bridge_dataset bridge_orig

http://www.mrgr.cn/news/91464.html

相关文章:

  • C语言——深入理解指针(2)(数组与指针)
  • Arm64架构CentOS7服务器搭建Fabric环境
  • Django 5实用指南(二)项目结构与管理
  • 【MySQL安装】
  • TMS320F28335二次bootloader在线IAP升级
  • 云计算架构学习之Ansible-playbook实战、Ansible-流程控制、Ansible-字典循环-roles角色
  • Docker安装Minio对象存储
  • 天翼云910B部署DeepSeek蒸馏70B LLaMA模型实践总结
  • 如何使用 vxe-table grid 全配置式给单元格字段格式化内容,格式化下拉选项内容
  • 小米电视维修记录 2025/2/18
  • Ubuntu学习备忘
  • 【TOT】Tree-of-Thought Prompting
  • python进阶篇-面向对象
  • 23种设计模式 - 模板方法
  • cesium视频投影
  • 前端VUE+后端uwsgi 环境搭建
  • Breakout Tool
  • 9.PG数据库层权限管理(pg系列课程)第2遍
  • ubuntu22.04离线安装K8S
  • DeepSeek部署到本地(解决ollama模型下载失败问题)