樹莓派官方最新64位(aarch64)系統(tǒng)安裝Pytorch和OpenCV
原文地址
一.設(shè)置鏡像源
armv7l是armhf的衍生,而在樹莓派中armhf默認是指32位(我不確定這個說法對不對,但在清華源里,armv7l用戶指的就是32位的用戶)。因為我們使用的是arm64架構(gòu)(也就是安裝的64位系統(tǒng)),所以我們選擇aarch64用戶的配置。用以下內(nèi)容替換原“/etc/apt/sources.list”里的內(nèi)容
- 先替換sources.list里面的內(nèi)容
sudo nano /etc/apt/sources.list
用下面的內(nèi)容替換
# aarch64 用戶:編輯 `/etc/apt/sources.list` 文件,用以下內(nèi)容取代:
# 默認注釋了源碼鏡像以提高 apt update 速度,如有需要可自行取消注釋
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
- 再替換raspi.list里面的內(nèi)容
sudo nano /etc/apt/sources.list.d/raspi.list
用下面的內(nèi)容替換
# 對于兩個架構(gòu),編輯 `/etc/apt/sources.list.d/raspi.list` 文件,刪除原文件所有內(nèi)容,用以下內(nèi)容取代:
deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ bullseye main
- 換源之后更新源
sudo apt-get update
sudo apt-get upgrade
二、安裝OpenCV
python -m pip install opencv-python
網(wǎng)上很多文章說下載whl文件,比較麻煩嗎。還有一些教程說先安裝libxxxxx庫,再安裝opencv,這些庫可以需要用的時候再安裝。文章來源:http://www.zghlxwxcb.cn/news/detail-635823.html
三、安裝Pytorch
python -m pip install torch
其它的需要使用時再安裝即可。文章來源地址http://www.zghlxwxcb.cn/news/detail-635823.html
到了這里,關(guān)于樹莓派最新64位系統(tǒng)安裝Pytorch和OpenCV的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!