file-type

Jetson Xavier/NX/nano快速安装PyTorch与torchVision的教程

下载需积分: 10 | 3KB | 更新于2024-08-28 | 185 浏览量 | 2 下载量 举报 收藏
download 立即下载
本篇文档是一份针对NVIDIA Jetson Xavier、NX和nano平台的详细安装指南,主要介绍如何在这些设备上安装PyTorch和torchvision库。Jetson系列,包括Jetson Xavier和Jetson NX,是专为边缘计算和人工智能应用设计的嵌入式开发板,而Jetson Nano则是更小型且入门级别的版本。 首先,值得注意的是,文档提供的资源来自于NVIDIA官方论坛,其中提到的是预构建的PyTorch pip wheel installers,这些安装包针对JetPack 4.2及更高版本,支持ARM aarch64架构,这意味着它们是为Jetson系列的处理器设计的,而非主机PC。提供的PyTorch版本涵盖了从v1.0.0到v1.7.0,用户可以根据自己的JetPack版本选择合适的安装包下载。 安装步骤分为两部分: 1. 下载PyTorch wheel安装文件:用户可以从提供的链接下载适合自己JetPack版本的PyTorch wheel文件,例如对于PyTorch v1.7.0,对应的下载链接是`https://nvidia.box.com/shared/static/wa34qwrwtk9njtyarwt5nvo6imenfy26.whl`,下载后保存为`torch-1.7.0-cp36-cp36m-linux_aarch64.whl`(或者其他版本对应的文件名)。 2. 安装依赖和执行安装命令:在Jetson设备上运行安装,需要先确保系统已经安装了基本的Python3依赖,如`python3-pip`, `libopenblas`, 和 `libopenmpi-dev`。然后,使用`pip3`命令来安装下载的wheel文件,安装命令示例如下: ``` Python3.6 wget <下载链接> sudo apt-get install python3-pip libopenblas-dev libopenmpi-dev pip3 install --no-index --find-links <保存wheel文件的路径> torch-1.7.0-cp36-cp36m-linux_aarch64.whl ``` 其中,`<下载链接>`和`<保存wheel文件的路径>`需要替换为实际的下载链接和文件路径。 完成以上步骤后,PyTorch及其相关的torchvision库就成功安装在了Jetson Xavier、NX或nano上,可以用于进行深度学习模型的开发、训练和推理任务。为了确保最佳性能和兼容性,建议在安装前检查设备的硬件配置和JetPack版本是否匹配,以及遵循官方文档中的任何特定注意事项。

相关推荐

filetype

(Log) PS D:\Project\Y\project\GraphLogAD-main\GraphLogAD-main> pip install torch_scatter Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting torch_scatter Downloading https://pypi.tuna.tsinghua.edu.cn/packages/f5/ab/2a44ecac0f891dd0d765fc59ac8d277c6283a31907626560e72685df2ed6/torch_scatter-2.1.2.tar.gz (108 kB) Preparing metadata (setup.py) ... done Building wheels for collected packages: torch_scatter DEPRECATION: Building 'torch_scatter' using the legacy setup.py bdist_wheel mechanism, which will be removed in a future version. pip 25.3 will enforce this behaviour change. A possible replacement is to use the standardized b uild interface by setting the `--use-pep517` option, (possibly combined with `--no-build-isolation`), or adding a `pyproject.toml` file to the source tree of 'torch_scatter'. Discussion can be found at https://github.com/pypa/pip/issues/6334 Building wheel for torch_scatter (setup.py) ... error error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [44 lines of output] C:\Users\23833\.conda\envs\Log\lib\site-packages\setuptools\dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated. !! ******************************************************************************** Please consider removing the following classifiers in favor of a SPDX license expression: License :: OSI Approved :: MIT License See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details. ******************************************************************************** !! self._finalize_license_expression() running bdist_wheel running build running build_py creating build\lib.win-amd64-cpython-310\torch_scatter copying torch_scatter\placeholder.py -> build\lib.win-amd64-cpython-310\torch_scatter copying torch_scatter\scatter.py -> build\lib.win-amd64-cpython-310\torch_scatter copying torch_scatter\segment_coo.py -> build\lib.win-amd64-cpython-310\torch_scatter copying torch_scatter\segment_csr.py -> build\lib.win-amd64-cpython-310\torch_scatter copying torch_scatter\testing.py -> build\lib.win-amd64-cpython-310\torch_scatter copying torch_scatter\utils.py -> build\lib.win-amd64-cpython-310\torch_scatter copying torch_scatter\__init__.py -> build\lib.win-amd64-cpython-310\torch_scatter creating build\lib.win-amd64-cpython-310\torch_scatter\composite copying torch_scatter\composite\logsumexp.py -> build\lib.win-amd64-cpython-310\torch_scatter\composite copying torch_scatter\composite\softmax.py -> build\lib.win-amd64-cpython-310\torch_scatter\composite copying torch_scatter\composite\std.py -> build\lib.win-amd64-cpython-310\torch_scatter\composite copying torch_scatter\composite\__init__.py -> build\lib.win-amd64-cpython-310\torch_scatter\composite running egg_info writing torch_scatter.egg-info\PKG-INFO writing dependency_links to torch_scatter.egg-info\dependency_links.txt writing requirements to torch_scatter.egg-info\requires.txt writing top-level names to torch_scatter.egg-info\top_level.txt reading manifest file 'torch_scatter.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '*' found under directory 'test' adding license file 'LICENSE' writing manifest file 'torch_scatter.egg-info\SOURCES.txt' running build_ext C:\Users\23833\.conda\envs\Log\lib\site-packages\torch\utils\cpp_extension.py:382: UserWarning: Error checking compiler version for cl: [WinError 2] 系统找不到指定的文件。 warnings.warn(f'Error checking compiler version for {compiler}: {error}') building 'torch_scatter._scatter_cpu' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for torch_scatter Running setup.py clean for torch_scatter Failed to build torch_scatter ERROR: Failed to build installable wheels for some pyproject.toml based projects (torch_scatter)