pytorch
wayne8088
这个作者很懒,什么都没留下…
展开
-
pytorch1.60 torch.nn在pycharm中无法自动智能提示
https://blog.csdn.net/winter2121/article/details/108799776转载 2021-05-15 09:45:17 · 177 阅读 · 0 评论 -
pytorch 预训练模型读取修改相关参数
resnet = resnet50(pretrained=False)resnet.load_state_dict(torch.load(args.predir)) res_conv31 = Bottleneck_dilated(1024, 256,dilated_rate = 2)print("---------------------",res_conv31)print("---------------------",resnet.layer3[1]) res_conv31.load_转载 2020-12-24 20:51:38 · 777 阅读 · 0 评论 -
google colab 打开tensorboard
# 先安装!pip install tensorboardX%load_ext tensorboard%tensorboard --logdir logs/sample_data原创 2020-11-05 11:33:57 · 768 阅读 · 0 评论 -
torch transform 用法大全
参照网址,https://www.pythonheidong.com/blog/article/147611/转载 2020-09-16 11:25:22 · 1249 阅读 · 0 评论 -
pytorch可视化之torchsummary
pip install torchsummaryimport torchimport torchvision as tvfrom torch.utils.data import DataLoaderimport torchvision.transforms as transforms # 必须要有,把PIL.Image.Image变成tensor才能计算from torchsummary import summaryvgg = tv.models.vgg16(pretrained=True原创 2020-08-12 18:14:19 · 2869 阅读 · 1 评论 -
自定义数据集 输入输出打包
# x,y为训练输入,和标准输出 train_dataset = torch.utils.data.TensorDataset(x, y)train_dataLoader = Data.DataLoader(train_dataset, batch_size=64, shuffle=True, num_workers=0)for step, (images, labels) in enume...原创 2020-05-06 08:09:56 · 364 阅读 · 0 评论 -
PyTorch使用cpu调用gpu训练的模型
加载模型的时候加上:map_locationmodel = torch.load(‘xxx.pkl’, map_location=lambda storage, loc: storage)model = model.module原创 2020-04-26 20:48:04 · 1127 阅读 · 0 评论 -
ERROR: No matching distribution found for torch==1.4.0 (from torchvision)
版本不匹配的问题。完美解决方案如下:目前torchvision最新版本是0.5,torch最新版本是1.5,使用命令。pip install --no-deps torchvision==0.5.0原创 2020-03-10 15:39:30 · 17393 阅读 · 16 评论