摘要: 解决RuntimeError: one of the variables needed for gradient computation has been modified by an inplace 阅读全文
posted @ 2021-05-05 16:50 临近边缘 阅读(33) 评论(0) 推荐(0)
摘要: torch.view torch.split() F.interpolate torch.contiguous() torch.argmax 阅读全文
posted @ 2021-04-18 11:03 临近边缘 阅读(100) 评论(0) 推荐(0)
摘要: torch.nn.unfold 提取滑动窗口patches 1 inputs = torch.randn(1, 2, 4, 4) 2 print(inputs.size()) 3 print(inputs) 4 unfold = torch.nn.Unfold(kernel_size=(2, 2), 阅读全文
posted @ 2021-04-18 10:43 临近边缘 阅读(1018) 评论(0) 推荐(0)
摘要: Padding :Same && Valid 阅读全文
posted @ 2021-04-18 09:37 临近边缘 阅读(68) 评论(0) 推荐(0)
摘要: 1 import time 2 import datetime 3 prev_time = time.time() #epoch循环之外 4 # epoch训练循环之内 5 batches_done = (epoch - start_iter + 1) * len(data_loader) + _ 阅读全文
posted @ 2021-04-16 20:10 临近边缘 阅读(162) 评论(0) 推荐(0)
摘要: 1 damaged_images = ground_truths * masks + (1 - masks) 2 outputs_comps = ground_truths * masks + outputs * (1 - masks) 3 if count % 1000 == 0: 4 sizes 阅读全文
posted @ 2021-04-16 20:08 临近边缘 阅读(44) 评论(0) 推荐(0)
摘要: tensorboard 可视化 1 from tensorboardX import SummaryWriter 2 writer = SummaryWriter(args.log_dir) 3 G_loss, G_loss_list = generator_loss(input_images, m 阅读全文
posted @ 2021-04-16 20:02 临近边缘 阅读(226) 评论(0) 推荐(0)
摘要: pytorch 模型的断点继训 pytorch 模型断点继训 1 checkpoint = { "model_state_dict": net.state_dict(), 2 "optimizer_state_dict": optimizer.state_dict(), 3 "epoch": epo 阅读全文
posted @ 2021-04-16 09:04 临近边缘 阅读(99) 评论(0) 推荐(0)
摘要: 总共数据是202599张图片,在这里的分了训练集162770(比例0.8),验证集19867(比例0.098),测试集19962(比例0.096) 这里是采用建立连接的方式 1 rel_link = os.path.relpath(in_file, out_dir) # 得到从out_file到in 阅读全文
posted @ 2021-04-07 11:21 临近边缘 阅读(571) 评论(0) 推荐(0)
摘要: img处理 1 trainset = train_dataset.InpaintDataset(opt) 2 print('The overall number of images equals to %d' % len(trainset)) View Code 1 def __init__(sel 阅读全文
posted @ 2021-03-29 20:38 临近边缘 阅读(201) 评论(0) 推荐(0)