logo
publist
写文章

简介

该用户还未填写简介

擅长的技术栈

可提供的服务

暂无可提供的服务

Job for smbd.service failed because the control process exited with error code. See “systemctl statu

错误$ sudo service smbd restartJob for smbd.service failed because the control process exited witherror code. See "systemctl status smbd.service" and "journalctl -xe"for details.$ systemctl status smbd.

pycharm 自动补全括号 引号

过程:File->settings->Editior->General->Smart Keys勾选Insert paired barckets(),[],{},<>

计算图片相似度的方法

文章目录1.余弦相似度计算2.哈希算法计算图片的相似度3.直方图计算图片的相似度4.SSIM(结构相似度度量)计算图片的相似度5.基于互信息(Mutual Information)计算图片的相似度1.余弦相似度计算把图片表示成一个向量,通过计算向量之间的余弦距离来表征两张图片的相似度。from PIL import Imagefrom numpy import average, dot, lina

#计算机视觉
pytorch 查看参数是否被训练 require_grad()

遍历named_parameters()中的所有的参数,只打印那些param.requires_grad=True的变量。for name, param in model.named_parmeters():if param.requires_grad:print(name)

Pytorch 报错: The size of tensor a (4) must match the size of tensor b (3) at non-singleton

原因分析1.读取的是.png 图片 是32位深度的,一般我们读取的是.jpg 24位深度的2.转换为RGB就行了test_image = Image.open(test_image_name).convert('RGB')

#深度学习
Pytorch GPU内存占用很高,但是利用率很低

1.GPU 占用率,利用率输入nvidia-smi来观察显卡的GPU内存占用率(Memory-Usage),显卡的GPU利用率(GPU-util)GPU内存占用率(Memory-Usage) 往往是由于模型的大小以及batch size的大小,来影响这个指标显卡的GPU利用率(GPU-util) 往往跟代码有关,有更多的io运算,cpu运算就会导致利用率变低。比如打印loss, 输出图像,等等这个

文章图片
#深度学习
DataParallel 和 DistributedDataParallel 的区别和使用方法

1.DataParallelDataParallel更易于使用(只需简单包装单GPU模型)。然而,由于它使用一个进程来计算模型权重,然后在每个批处理期间将分发到每个GPU,因此通信很快成为一个瓶颈,GPU利用率通常很低。nn.DataParallel要求所有的GPU都在同一个节点上(不支持分布式),而且不能使用Apex进行混合精度训练。https://zhuanlan.zhihu.com/p/11

#深度学习
Pytorch:保存图片

1. 直接保存Tensor#!/usr/bin/env python# _*_ coding:utf-8 _*_import torchfrom torchvision import utils as vutilsdef save_image_tensor(input_tensor: torch.Tensor, filename):"""将tensor保存为图片:param input_tenso

#深度学习
python,pytorch:读取,保存,显示图片

文章目录一,Pytorch1. 直接保存Tensor2.Tensor 转CV2 保存二、python1. opencv2.matplotlib:3. PIL一,Pytorch1. 直接保存Tensor#!/usr/bin/env python# _*_ coding:utf-8 _*_import torchfrom torchvision import utils as vutilsdef sa

#深度学习
    共 11 条
  • 1
  • 2
  • 请选择