conv1d conv1 torch conv

使用model.eval( ) 和 torch.no_grad( )的情况

神经网络每训练1个epoch 会紧接着 evaluate一下,PyTorch提供了model.eval( )和torch.no_grad( ),验证时会使用 model.eval( ) 开启评估模式, 在训练阶段,网络的Dropout 层和BatchNorm 层处于train开启的模式; 在验证阶段 ......
no_grad 情况 model torch eval

pip安装cuda版torch

一开始安装torch的时候没有指定cuda版本,所以安装的是cpu版本,无法调用gpu 可以使用如下安装方法: pip install torch -f https://download.pytorch.org/whl/cu118/torch_stable.html(应该可以用) pip insta ......
torch cuda pip

torch+torchvision+cuda10.1

torch1.7.1 # CUDA 10.1 pip install torch==1.7.1+cu101 torchvision==0.8.2+cu101 torchaudio==0.7.2 -f https://download.pytorch.org/whl/torch_stable.html ......
torchvision torch cuda 10.1 10

DDP运行报错(单卡无错):ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1)

使用DDP时出现错误,但是单卡跑无错误。 错误记录如下: RuntimeError: Expected to have finished reduction in the prior iteration before starting a new one. This error indicates ......

安装torch报错ERROR: torch has an invalid wheel, .dist-info directory not found

要搭建一篇论文算法的环境,根据yaml文档提供的安装包利用conda进行安装,出现了以上问题,尝试 pip install torch==1.7.0 -f https://download.pytorch.org/whl/torch_stable.html 成功安装 问题原因:之前更换了国内清华源, ......
torch dist-info directory invalid ERROR

torch.utils.data

Dataset子类 dataset子类用用构建数据集。是一个抽象类,==需要重写__getitem__函数。== 代码示例如下: from torch.utils.data import Dataset from PIL import Image import os class Mydata(Dat ......
torch utils data

RepLKNet、depthwise conv、Depthwise Separable Conv

由于ResNet的残差结构会跳过一些网络结果,所以其实resnet的有效深度其实并不深,所以有效感受野并不大。而大kernel模型不但有效感受野更大而且更像人类(shape bias高)。这也可能是传统CNN虽然在ImageNet上跟Transformer差不多,但在下游任务上普遍不如Transfo ......
Depthwise depthwise Separable RepLKNet Conv

每日学习记录20230406_bert_and_torch

20230407:tensorflow transformer tf.name_scope: 这个函数会规定对象和操作属于那个范围,但是不会对“对象”的“作用域”产生任何影响,也就是不是全局变和局部变量的概念. 这个东西有很多种用法: with tf.name_scope("loss"): #这个名 ......
bert_and_torch 20230406 torch bert and

:)关于torch函数中dim的解释-读这篇就够了-|

关于torch函数中dim的解释-读这篇就够了 1 dim的取值范围 1)-1的作用 0,1,2,-1. 其中-1 最后一维 即 2 0,1,2,3,-1其中-1 最后一维 即3 2)维度 0,1,2,3表示 BCHW,常在CV任务中使用。 0,1,2 表示 CHW, 常在NLP任务中使用。 3)用 ......
函数 torch dim

python-torch numpy matploit pandas

title: 深度学习基础 torch numpy pandas matplotlib numpy 数组对象是 NumPy 中最核心的组成部分,这个数组叫做 ndarray,是“N-dimensional array”的缩写。其中的 N 是一个数字,指代维度. 在 NumPy 中,数组是由 nump ......
python-torch matploit python pandas numpy

torch.clamp()函数、torch.mean()、torch.sum()、torch哈达玛积和普通乘积、torch.expand()函数和torch.expand_as()函数

torch.clamp()函数 参考博客:https://blog.csdn.net/weixin_39504171/article/details/106069230 torch哈达玛积和普通乘积 https://zhuanlan.zhihu.com/p/537877779 torch.mean( ......
torch 函数 乘积 expand expand_as

Python小练习:优化器torch.optim的使用

Python小练习:优化器torch.optim的使用 作者:凯鲁嘎吉 - 博客园 http://www.cnblogs.com/kailugaji/ 本文主要介绍Pytorch中优化器的使用方法,了解optimizer.zero_grad()、loss.backward()以及optimizer. ......
Python torch optim

torch梯度计算相关

torch梯度计算图 计算图中,默认只有叶子结点的梯度能够保留,如果要访问非叶子结点p的梯度数据,需要执行p.retain_grad(). torch计算图中requires_grad与detach的区别 requires_grad是torch.Tensor中的属性,表示该张量是否需要计算梯度.而d ......
梯度 torch

64 int conv real

ok 成功实现 ......
conv real int 64

邻接矩阵、稀疏矩阵(torch, sparse, numpy)相互转换 [转载]

原链接:邻接矩阵转稀疏矩阵 邻接矩阵转稀疏矩阵 Example: import scipy.sparse as sp import numpy as np import torch adj_matrix = torch.randint(0,2,(4,4)) print(adj_matrix) # 输 ......
矩阵 sparse torch numpy
共105篇  :4/4页 首页上一页4下一页尾页