![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Pytorch
超级无敌小小顺利
计算机视觉
展开
-
pytorch自动混合精度训练
from torch.cuda.amp import autocast, GradScaler # Init Step 1: Create Model model, device, start_epoch = create_model(opt) if torch.cuda.device_count() > 1: model = nn.DataParallel(model) model.cuda() # Init Step 2: Cre...原创 2020-11-17 11:24:23 · 677 阅读 · 0 评论 -
Pytorch 入门
1.加载模型 seg_model=torchvision.models.detection.maskrcnn_resnet50_fpn(pretrained=True) seg_model=seg_model.cuda(1) seg_model=seg_model.eval() 2.将图像封装为tensor: torchvision.transforms.functional.to_tensor(img_pil).cuda() #cuda之后可以指定ID 3.从模型取出结果: cond_per...原创 2020-07-28 15:59:21 · 176 阅读 · 0 评论