Python 官方文档:入门教程 => 点击学习
python 3.11 安装PyTorch开发环境 # 环境 ubuntu 18.04, 选择环境 CUDA 11.6, 之前已安装驱动和CUDA,CUDNN环境 # 安装 python3.11 sudo add-apt-repositor
sudo add-apt-repository ppa:deadsnakes/ppasudo apt update sudo apt install Python3.11
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1
sudo apt install python3.11-venv python3.11 -m ensurepip
python -m pip install torch --extra-index-url https://download.pytorch.org/whl/cu116
## 实际上,我是
wget Https://download.pytorch.org/whl/cu116/torch-1.13.0%2Bcu116-cp311-cp311-linux_x86_64.whl python -m pip install torch-1.13.0+cu116-cp311-cp311-linux_x86_64.whl
打开 https://download.pytorch.org/whl/torchvision/
下载 torchvision-0.14.0+cu116-cp310-cp310-linux_x86_64.whl
当时没有针对3.11版本的,于是下载了3.10的,然后改名为:
torchvision-0.14.0+cu116-cp311-cp311-linux_x86_64.whl
再安装
python -m pip install torchvision-0.14.0+cu116-cp311-cp311-linux_x86_64.whl
>>> import timm
Traceback (most recent call last):
File "", line 1, in
File "/home/ubuntu/.local/lib/python3.11/site-packages/timm/__init__.py", line 2, in
from .models import create_model, list_models, is_model, list_modules, model _entrypoint, \
File "/home/ubuntu/.local/lib/python3.11/site-packages/timm/models/__init__.py ", line 28, in
from .maxxvit import *
File "/home/ubuntu/.local/lib/python3.11/site-packages/timm/models/maxxvit.py" , line 216, in
@dataclass
^^^^^^^^^
File "/usr/lib/python3.11/dataclasses.py", line 1221, in dataclass
return wrap(cls)
^^^^^^^^^
File "/usr/lib/python3.11/dataclasses.py", line 1211, in wrap
return _process_class(cls, init, repr, eq, order, unsafe_hash,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/dataclasses.py", line 959, in _process_class
cls_fields.append(_get_field(cls, name, type, kw_only))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/dataclasses.py", line 816, in _get_field
raise ValueError(f'mutable default {type(f.default)} for field '
ValueError: mutable defaultfor fie
需要指定一个低一点的版本
python -m pip install timm==0.6.7
来源地址:https://blog.csdn.net/makao007/article/details/127674463
--结束END--
本文标题: Python 3.11 安装深度学习Pytorch开发环境
本文链接: https://lsjlt.com/news/409739.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0