目录
1 导入tensorboard-前提安装tensorboard!
【学习资源】from torch.utils.tensorboard import SummaryWriter导入不成功问题_
from torch.utils.tensorboard import SummaryWriter导入不成功问题
- ImportError: TensorBoard logging requires TensorBoard with Python summary writer installed.
- 原因:SummaryWriter是存在于tensorboardX(其作为tensorboard的子模块)
- def load_ckpt(args, depth_model, shift_model, focal_model):
- if os.path.isfile(args.load_ckpt):
- print("loading checkpoint %s" % args.load_ckpt)
- checkpoint = torch.load(args.load_ckpt)
- # depth_model.load_state_dict(checkpoint['net'])
- depth_model.load_state_dict(torch.load(args.load_ckpt))
- del checkpoint
- torch.cuda.empty_cache()
torch.save(model.state_dict(), '位置/命名%d.pth'% (epoch))
tensorboard --logdir=tensor
- tensorboard --logdir=randruns --port=6020
- # 6020自定