logo
publist
写文章

简介

该用户还未填写简介

擅长的技术栈

可提供的服务

暂无可提供的服务

神经网络梯度裁剪

nn.utils.clip_grad_norm(parameters, max_norm, norm_type=2)#max_norm 5

#经验分享
计算LPIPS

import lpipsimport osimport utils_image as utilloss_fn_alex = lpips.LPIPS(net='vgg')#也可以选择alexinputpath = r'E:\testresult'#(alex:0.1009) (vgg:0.1879)gtpath=r'F:\eval_normal'imgs=os.listdir(path)losssu

#python#深度学习
Anaconda设置channel、常用命令

1.查看channelconda config --show#显示出所有conda的config信息conda config --show channels#只显示channels的信息2.删除channelconda config –remove channelshttps://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free3.增加channelc

#python
Python设置随机数种子

原因:使用相同种子保证每次实验生成固定的随机数,使每次实验结果一致。不同种子生成不一样的随机数。seed = random.randint(1, 10000)print('Random seed: {}'.format(seed))random.seed(seed)np.random.seed(seed)torch.manual_seed(seed)torch.cuda.manual_seed_a

#python
到底了