摘要: 1、代码的坑 images, labels = dataiter.next() # 错误未知 是个坑 解决办法: 用 images, labels = next(dataiter)替换images, labels = dataiter.next() 成功运行! 在网上找python迭代器的写法,也没 阅读全文
posted @ 2022-11-05 23:10 JaxonYe 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 1、代码 import torch import torch.nn as nn import torch.nn.functional as F import numpy as np class Net(nn.Module): def __init__(self): super(Net, self). 阅读全文
posted @ 2022-11-05 18:05 JaxonYe 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 1、代码 """ 让我们来看一个训练步骤。 对于此示例,我们从torchvision加载了经过预训练的 resnet18 模型。 我们创建一个随机数据张量来表示具有 3 个通道的单个图像,高度&宽度为 64,其对应的label初始化为一些随机值。 """ import torch, torchvis 阅读全文
posted @ 2022-11-05 17:14 JaxonYe 阅读(467) 评论(0) 推荐(0) 编辑
摘要: https://pytorch.apachecn.org/#/ 1、代码 import torch import numpy as np data = [[1, 2], [3, 4]] print(f"data:{data}") x_data = torch.tensor(data) print(f 阅读全文
posted @ 2022-11-05 17:11 JaxonYe 阅读(44) 评论(0) 推荐(0) 编辑
摘要: 1、相关课程 2、数据集 https://paperswithcode.com/datasets 里面有7000多个ML领域的各种数据集以及对应的paper,而且还分好了类 阅读全文
posted @ 2022-11-05 17:03 JaxonYe 阅读(14) 评论(0) 推荐(0) 编辑
摘要: 1、打开开发者工具 点浏览器右上角这个按钮,然后选择更多工具,选择开发者工具 或者直接按ctrl+shift+i即可弹出开发者工具 2、按ctrl+shift+p弹出run窗口 ,搜索shot 点击这个,即可长截图 OK! 阅读全文
posted @ 2022-11-05 16:54 JaxonYe 阅读(2055) 评论(0) 推荐(0) 编辑