
pytorch
文章平均质量分 67
答案是你
live日记:https://space.bilibili.com/345751891
展开
-
torchvision.transforms
transforms包含了一些常用的图像变换,这些变换能够用Compose串联组合起来。另外,torchvision提供了torchvision.transforms.functional模块。functional可以提供了一些更加精细的变换,用于搭建复杂的变换流水线(例如分割任务)。 原文链接:中文文档 1.CenterCrop class torchvision.transforms.CenterCrop(size) 在中心处裁剪PIL图片。 参数:size(序列 或 int)– 需要裁剪出的形状。如原创 2021-06-02 23:51:37 · 515 阅读 · 0 评论 -
pytorch resnet训练中出现的错误总结
错误1:pytorch训练报错TypeError: batch must contain tensors, numbers, dicts or lists found class PIL.Image.Image 原因:送入dataloader的img是 解决方案: 错误2:RuntimeError: The size of tensor a (58) must match the size of tensor b (56) at non-singleton dimension 3 错误3: File"D:\原创 2021-04-13 00:55:44 · 3472 阅读 · 0 评论