
pytorch
换个名字就很好
这个作者很懒,什么都没留下…
展开
-
训练了两回
训练了两回因为类的init函数已经调用了train函数原创 2023-02-22 11:09:15 · 166 阅读 · 0 评论 -
[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool after fork. (function pthreadpool)
keaking caffe2 thread-pool after fork原创 2023-02-20 11:18:34 · 594 阅读 · 1 评论 -
pytorch生成绿色背景图片
pytorch生成绿色背景图片原创 2023-02-07 15:56:41 · 325 阅读 · 0 评论 -
RuntimeError: Default process group has not been initialized, please make sure to call init_process_
default porcess group has not been initialized, please make sure to call init_process_syncbatchnorm 只能多GPU训练原创 2023-02-01 18:41:54 · 1214 阅读 · 0 评论 -
expected scalar type Long but found Int
报错信息expected scalar type Long but found Int或者expected scalar type Long but found Float报错场景pytorch的分类,本例具体为torch.nn.crossentropyloss原因pytorch的分类的loss函数的label的类型只能是torch.LongTensor类型(也是torch.int64类型),其他类型比如torch.int32,torch.float32等等会报错。我自己的是从np.long原创 2022-01-30 21:42:20 · 10085 阅读 · 2 评论 -
pytorch repeat
x.repeat(m,n,z…)在第0维度把x重复m次,在第1维度重复重复m次,以此类推。import torchx = torch.tensor([1, 2, 3])y = x.repeat(4, 2)print(y)print(y.size())y = x.repeat(4, 2, 1)print(y)print(y.size())y = x.repeat(4,)print(y)print(y.size())tensor([[1, 2, 3, 1, 2, 3],原创 2021-12-02 10:08:11 · 344 阅读 · 0 评论 -
2021-10-15-torch.cat()
torch.cat()import torchb, c, w, h = 2, 3, 4, 4x = torch.zeros(b, c, w, h)print(x.shape) # torch.Size([2, 3, 4, 4])mean=[0.485, 0.456, 0.406] #rgbstd =[0.229, 0.224, 0.225]get_channel = x[:,[0]]print(get_channel.shape) # torch.Size([2, 1, 4, 4])原创 2021-10-15 18:00:55 · 236 阅读 · 0 评论