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

下载安装运行测试开源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清理磁盘
在这里插入图片描述


http://www.kler.cn/a/550443.html

相关文章:

  • 计算机网络之路由算法的详细层次算法
  • C语言进阶习题【2】(4结构体进阶)——通讯录的实现2
  • hive全量迁移脚本
  • 计算光学基础
  • 【设计模式】【结构型模式】桥接模式(Bridge)
  • VueRouter 实例
  • 基于Flask的广西高校舆情分析系统的设计与实现
  • 深入理解 Shell 脚本执行方式:`source`、`./xx.sh`、`bash xx.sh` 和 `sh xx.sh`
  • leetcode88.合并两个有序数组
  • CMake configure_file
  • 数字水印嵌入及提取系统——基于小波变换GUI
  • 基于springcloud微服务架构的巡游出租管理平台
  • JDK、Nginx、Kafka、Zookeeper安装部署
  • 网络安全专业好就业吗?
  • 【力扣】114.二叉树展开为链表
  • 使用神经网络对驾驶数据进行道路类型分类
  • TCP/IP参考模型之区别(Differences Between the OSI and TCP/IP Reference Models)
  • python下载文件
  • QML 部件获得焦点触发的全局槽函数 onActiveFocusItemChanged
  • Android车机DIY开发之软件篇(十七) Android模拟器移植Automotive