foundationstereo模型的安装部署与运行
硬件RTX5060(8GB显存) Intel(R) Core(TM) i7-14650HX 32GB内存nvidia环境驱动 580.126.09 CUDA Version 12.81. 安装torch由于显卡架构 sm_120 原因官方提供的包在后续编译第三方库时会有环境兼容问题仍然采用nightly支持版本#1 创建 conda 环境手动删除 torch torchision编译第三方库 conda env create -f environment.yml conda activate foundation_stereo #2 手动安装 torch torchision pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu1282. 安装 flash-attnexport TORCH_CUDA_ARCH_LIST12.0 pip install gitGitHub - Dao-AILab/flash-attention: Fast and memory-efficient exact attention --no-build-isolation这一步比较耗时间和RAM大小有关。如果内存过小会出现系统死机这时可以设置进程数降低RAM占用但时间也会进一步增加# 数字视情况而定 export JBOS_MAX 13. 检查一下环境是否successpython - PY import torch from flash_attn import flash_attn_func qtorch.randn(1,128,8,64,devicecuda,dtypetorch.float16) ktorch.randn(1,128,8,64,devicecuda,dtypetorch.float16) vtorch.randn(1,128,8,64,devicecuda,dtypetorch.float16) oflash_attn_func(q,k,v) print(output device:,o.device) print(dtype:,o.dtype) PY4. demo运行之后会遇到报错ValueError: Unknown scheme for proxy URL URL(socks://127.0.0.1:7897/)这个错误通常是因为系统里设置了代理环境变量而httpx库无法识别socks://这种简写格式解决方式为export all_proxysocks5://127.0.0.1:7897 export ALL_PROXYsocks5://127.0.0.1:7897然后再运行demo脚本报错即可解决5. bug修复除此之外运行还有可能会碰到错误UnpicklingError: Weights only load failed. This file can still be loaded, to do so you have two options, do those steps only if you trust the source of the checkpoint.解决方法为找到代码第62行附近ckpt torch.load(ckpt_dir)增加weights_only参数ckpt torch.load(ckpt_dir, weights_onlyFalse)
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2429050.html
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!