随笔分类 -  pytorch

摘要:解决RuntimeError: one of the variables needed for gradient computation has been modified by an inplace 阅读全文
posted @ 2021-05-05 16:50 临近边缘 阅读(37) 评论(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 临近边缘 阅读(1019) 评论(0) 推荐(0)
摘要:Padding :Same && Valid 阅读全文
posted @ 2021-04-18 09:37 临近边缘 阅读(69) 评论(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 临近边缘 阅读(164) 评论(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 临近边缘 阅读(46) 评论(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 临近边缘 阅读(238) 评论(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 临近边缘 阅读(104) 评论(0) 推荐(0)
摘要:使用Xshell 先与服务器建立连接,点击按钮 隧道 在Xshell > 文件 > 属性 > 连接 > SSH > 隧道 源主机和目标主机 都是 localhost不变,不要改成本机IP和服务器地址了。直接将侦听端口 和 目标端口 都设置成6007(tensorboard的访问地址) 即可。 在服务 阅读全文
posted @ 2021-03-24 19:54 临近边缘 阅读(65) 评论(0) 推荐(0)
摘要:scipy库的版本不一致报错 1、imread AttributeError: module ‘scipy.misc‘ has no attribute ‘imread‘ before:img = scipy.misc.imread(myImage) after: import imageio im 阅读全文
posted @ 2021-03-24 14:18 临近边缘 阅读(280) 评论(0) 推荐(0)