python - 在 Jetson Nano Ubuntu 18 上安装 PyTorch

标签 python ubuntu installation pytorch

我正在尝试在 Jetson Nano Ruining Ubuntu 1804 上安装 PyTorch。我的引用是 https://dev.to/evanilukhin/guide-to-install-pytorch-with-cuda-on-ubuntu-18-04-5217
当我尝试以下命令时,这就是我得到的:

(my_env) crigano@crigano-desktop:~$ python3.8 -m pip install numpy ninja pyyaml mkl mkl-include setuptools cmake cffi typing
Collecting numpy
  Using cached numpy-1.20.2-cp38-cp38-manylinux2014_aarch64.whl (12.7 MB)
Collecting ninja
  Using cached ninja-1.10.0.post2.tar.gz (25 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting pyyaml
  Using cached PyYAML-5.4.1-cp38-cp38-manylinux2014_aarch64.whl (818 kB)
ERROR: Could not find a version that satisfies the requirement mkl
ERROR: No matching distribution found for mkl

最佳答案

如果您只想在裸机 Jetson Nano 上使用 PyTorch,只需使用 NVIDIA's pre-compiled binary wheel 安装即可.其他软件包可在 Jetson Zoo 中找到.
MKL 由英特尔开发,“用于优化英特尔® CPU 和 GPU 的当前和 future 几代 的代码。” [PyPI] .显然,它确实可以在 AMD 等其他基于 x86 的芯片上运行(尽管英特尔历来故意削弱非英特尔芯片的库 [Wikipedia]),但不出所料,英特尔对支持 ARM 设备不感兴趣,也没有将 MKL 移植到 ARM 架构。
如果您的目标是在 numpy 中使用 MKL 进行数学优化, openblas是 ARM 的可行替代方案。 libopenblas-base:arm64libopenblas-dev:arm64预装在 NVIDIA 的 "L4T PyTorch" Docker images 上.您可以确认numpynumpy.__config__.show() 检测它们.这就是我在 l4t-pytorch:r32.5.0-pth1.6-py3 上的 python 3.69 中使用 numpy 1.12 得到的结果。图片:

blas_mkl_info:
  NOT AVAILABLE
blis_info:
  NOT AVAILABLE
openblas_info:
    libraries = ['openblas', 'openblas']
    library_dirs = ['/usr/lib/aarch64-linux-gnu']
    language = c
    define_macros = [('HAVE_CBLAS', None)]
blas_opt_info:
    libraries = ['openblas', 'openblas']
    library_dirs = ['/usr/lib/aarch64-linux-gnu']
    language = c
    define_macros = [('HAVE_CBLAS', None)]
lapack_mkl_info:
  NOT AVAILABLE
openblas_lapack_info:
    libraries = ['openblas', 'openblas']
    library_dirs = ['/usr/lib/aarch64-linux-gnu']
    language = c
    define_macros = [('HAVE_CBLAS', None)]
lapack_opt_info:
    libraries = ['openblas', 'openblas']
    library_dirs = ['/usr/lib/aarch64-linux-gnu']
    language = c
    define_macros = [('HAVE_CBLAS', None)]
所以大概它会使用openblas代替 MKL 进行数学优化。如果您的用例也适用于 numpy优化,同样可以使用openblas并且不应该需要 MKL ......这是幸运的,因为它无论如何都不可用。 😅

关于python - 在 Jetson Nano Ubuntu 18 上安装 PyTorch,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66995722/

相关文章:

python - 无法再为 requirements.txt 文件中的 Google Cloud Dataflow 作业安装 `google-cloud-datastore` 依赖项

python - django [Errno 2] 没有那个文件或目录 :

python - 在使用 python 请求下载之前获取 mp4 文件大小

python - python中的有界圆插值

c# - 在 Mono 上运行 ASP.NET 5 的 Ubuntu 上使用 MVC 6 调整图像大小

linux - 如何强制所有请求都来 self 的网站以避免使用 Apache 进行欺骗

ruby-on-rails - 我可以在 Ubuntu 上使用 apt-get 安装 gems 吗?

Android 无法在我的测试手机 Pixel XL 上安装从 Eclipse 移植到 Android Studio 的应用程序

sql-server - 如何安装 SQL Server Management Studio 2012 (SSMS) Express?

ruby - 使用 rvm 安装 gem