赞
踩
https://developer.nvidia.cn/zh-cn/cuda-gpus
https://developer.nvidia.com/cuda-toolkit-archive
https://developer.nvidia.cn/rdp/cudnn-archive
https://www.bilibili.com/video/BV1dd4y1k7Ru/?spm_id_from=333.788.recommend_more_video.-1&vd_source=de0d211161a3b451f44a5c8e732dcbe2
https://www.bilibili.com/video/BV1nL4y1b7oT/?spm_id_from=333.337.search-card.all.click&vd_source=de0d211161a3b451f44a5c8e732dcbe2
https://blog.csdn.net/weixin_42838061/article/details/113107234?utm_source=app&app_version=5.0.1&code=app_1562916241&uLinkId=usr1mkqgl919blen
https://www.anaconda.com/products/individual
这里的pytorch可以是任意名字
conda create -n pytorch python=3.8
conda activate pytorch
pip list
conda install pytorch torchvision torchaudio cpuonly -c pytorch-lts
选择私有环境
找到Anaconda安装包,如图配置(我这里由IDE工具自动填充了内容)
conda activate pytorch #切换工作空间,如果已在可不操作
conda install nb_conda
jupyter notebook
运行快捷键Shift+Enter
返回false不支持显卡加速,不影响使用
import torch
torch.cuda.is_available()
pip install tensorboard -i https://pypi.douban.com/simple/
from torch.utils.tensorboard import SummaryWriter
writer = SummaryWriter("logs")
for i in range(100):
writer.add_scalar("y=x",i,i)
writer.close()
注意路径是logs上一层
tensorboard --logdir logs
---------------------常用命令
#装conda切换源
https://zhuanlan.zhihu.com/p/449701244
#创建虚拟环境
conda create -n py38 python=3.8
ssl报错报错看这个
https://blog.csdn.net/xiangfengl/article/details/127597065
切换环境报错解决方法:
修改环境变量----->C:\ProgramData\Anaconda3\Scripts (必须删除,不能保留,否则报错)
1、改成 C:\ProgramData\Anaconda3\condabin
2、以及C:\ProgramData\Anaconda3
conda activate py38
pip install -r .\requirements1.txt
-------------------报错集合---------------------
AttributeError: ‘Upsample‘ object has no attribute ‘recompute_scale_factor‘
https://blog.csdn.net/Thebest_jack/article/details/124723687
将model.half()和img.half()改为.float()
pip uninstall numpy #删除
pip install numpy==1.23.5 #指定版本安装
#cv2找不到,引入代码改成
import cv2
------------vscode切换python源--------------
按键Ctrl+Shift+P
输入
Python:Select Interpreter
-------------conda常用-----------------
pytorch仓库的创建
#创建虚拟环境
conda create -n your_env_name python=3.8
#删除虚拟环境
conda remove -n your_env_name(虚拟环境名称) --all
#激活虚拟环境
conda activate your_env_name
#退出虚拟环境
conda deactivate
#查看列表
conda env list
#查看显卡
nvidia-smi
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。