【深度学习环境-3】Ubuntu 18.04安装配置ZED2环境

Install the ZED Python API | Stereolabs

ZED SDK 3.2 - Download | Stereolabs

1、下载对应的ZED SDK 

【深度学习环境-3】Ubuntu 18.04安装配置ZED2环境_第1张图片

【深度学习环境-3】Ubuntu 18.04安装配置ZED2环境_第2张图片

 2、ZED SDK安装

chmod +x ZED_SDK_Ubuntu18_cuda11.0_v3.2.2.run
./ZED_SDK_Ubuntu18_cuda11.0_v3.2.2.run

3、测试

cd /usr/local/zed/tools
./ZED_Depth_Viewer

踩坑记录:

1、先安装了ZED SDK 3.5.6,import pyzed成功,但import pyzed.sl失败,显示illegal instructions,故打算卸载ZED SDK 3.5.6,重新安装3.2.2。

若安装过不同版本的ZED SDK,则可能会导致模块导入失败,需要全部卸载。

#/usr/local/zed 这个目录全部删掉
sudo rm -rf zed
pip3 uninstall pyzed
pip uninstall pyzed

可以通过sudo find -name zed(zed sdk pyzed)等关键词查询把以前安装过的全部删除干净

2、ZED python API安装失败

在安装ZED SDK的过程中,可能因为网络问题,ZED python API安装失败,可采用以下方式:

dell@dell-Precision-3640-Tower:/usr/local/zed$ python3 get_python_api.py 
CUDA 11.0
Platform ubuntu18
ZED 3.2
Python 3.6
Downloading python package from https://download.stereolabs.com/zedsdk/3.2/ubuntu18/cu110/py36 ...

-> Please make sure numpy is installed 
 python3 -m pip install cython
 python3 -m pip install numpy
File saved into pyzed-3.2-cp36-cp36m-linux_x86_64.whl
To install it run : 
 python3 -m pip install pyzed-3.2-cp36-cp36m-linux_x86_64.whl
dell@dell-Precision-3640-Tower:/usr/local/zed$ python3 -m pip install cython
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: cython in /home/dell/.local/lib/python3.6/site-packages (0.29.32)
dell@dell-Precision-3640-Tower:/usr/local/zed$ python3 -m pip install numpy
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: numpy in /home/dell/.local/lib/python3.6/site-packages (1.19.5)
dell@dell-Precision-3640-Tower:/usr/local/zed$ python3 -m pip install pyzed-3.2-cp36-cp36m-linux_x86_64.whl
Defaulting to user installation because normal site-packages is not writeable
Processing ./pyzed-3.2-cp36-cp36m-linux_x86_64.whl
Installing collected packages: pyzed
Successfully installed pyzed-3.2
dell@dell-Precision-3640-Tower:/usr/local/zed$ python3
Python 3.6.9 (default, Jun 29 2022, 11:45:57) 
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyzed
>>> import pyzed.sl
>>> 

3、有时在安装过程中出现依赖包安装失败的问题,建议更换源。

# 备份源文件
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
# 增加以下源文件
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
# 更新源
sudo apt-get update

 # 慎用!慎用!慎用!

# 升级软件,有的博文推荐使用此命令,但此命令慎用,会导致内核升级,无法开机,

sudo apt-get upgrade

参考链接 <ZED相机开发> jetsonnano linux ubuntu 安装ZED SDK3.6.2_SHU_RYE的博客-CSDN博客

你可能感兴趣的:(ubuntu,linux,运维)