Pytorch
Axiiiz
这个作者很懒,什么都没留下…
展开
-
PyTorch查看CUDA支持情况
import torchimport torchvisionprint(torch.cuda.is_available())上面的命令只是检测CUDA是否安装正确并能被Pytorch检测到,并没有说明是否能正常使用,要想看Pytorch能不能调用cuda加速,还需要简单的测试一下:a = torch.Tensor(5,3)a = a.cuda()print(a)Cuda runtime error (48) : no kernel image is available for execu转载 2021-06-23 21:13:33 · 3833 阅读 · 0 评论 -
PyTorch学习率调整可视化 lr_scheduler
import torchimport torch.nn as nnimport itertoolsimport matplotlib.pyplot as pltinitial_lr = 0.1epochs = 100# 定义一个简单的模型class model(nn.Module): def __init__(self): super().__init__() self.conv1 = nn.Conv2d(in_channels=3, out_cha转载 2021-06-23 19:27:16 · 557 阅读 · 0 评论 -
Module ‘cv2.cv2‘ has no attribute ‘ximgproc‘
>>> import cv2>>> seeds = cv2.ximgproc.createSuperpixelSEEDS(img_sp.shape[1], img_sp.shape[0], img_sp.shape[2], num_superpixels, 15, 3, 5, True)Traceback (most recent call last):AttributeError: module 'cv2.cv2' has no attribute 'ximgp转载 2021-05-22 20:21:47 · 625 阅读 · 0 评论 -
PyTorch 下载地址
https://download.pytorch.org/whl/torch_stable.html添加链接描述原创 2021-05-22 20:14:53 · 174 阅读 · 0 评论 -
class BatchNorm1d(_BatchNorm):
y=x−E[x]Var[x]+ϵ∗γ+βy = \frac{x - \mathrm{E}[x]}{\sqrt{\mathrm{Var}[x] + \epsilon}} * \gamma + \betay=Var[x]+ϵx−E[x]∗γ+βThe mean and standard-deviation are calculated per-dimension over the mini-batches and :math:\gamma and :math:\beta are learnable par原创 2020-08-03 14:45:01 · 253 阅读 · 0 评论 -
tensor,Image,numpy和opencv格式的相互转换
读取转换保存总结原创 2020-05-19 23:27:12 · 941 阅读 · 0 评论 -
[安装笔记]:Windows+Anaconda3+PyTorch+PyCharm
目录1. 安装Anaconda32. 查看电脑显卡信息3. 创建PyTorch环境4. PyTorch安装5. 验证安装成功6. PyCharm中配置PyTorch1. 安装Anaconda3官网下载Anaconda3:https://www.anaconda.com/distribution/运行下载好的.exe文件Win+R 调出运行对话框,输入 cmd 回车,输入 py...原创 2020-04-02 18:45:53 · 582 阅读 · 0 评论 -
Pytorch教程学习笔记
Pytorch教程学习笔记转载自:Teeyohuang 分类专栏 - Pytorch学习笔记Pytorch进行CIFAR-10分类CIFAR-10数据加载和处理定义卷积神经网络定义损失函数和优化器训练测试Pytorch进行mnist训练和测试Pytorch创建自己的数据集用于分类的数据集用于分割的数据集参考:https://blog.csdn.n...转载 2020-03-23 14:01:32 · 166 阅读 · 0 评论