自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(25)
  • 资源 (1)
  • 收藏
  • 关注

原创 PyTorch之Tensors

官方文档链接:https://pytorch.org/tutorials/beginner/blitz/tensor_tutorial.html#sphx-glr-beginner-blitz-tensor-tutorial-pyTensorsTensors 与 NumPy 的 ndarray 类似,此外,Tensors 也可用于 GPU 以加速计算导包,安装教程:https://editor.csdn.net/md/?articleId=110280819from __future__ impor

2020-12-03 15:26:31 175 2

原创 Windows10 + Anaconda(python3.6)安装labelling

进入要安装的环境:conda activate pytorch安装PyQt5(python3及以上更建议安装PyQt5)conda install pyqt=5或者pip install PyQt5安装lxmlconda install -c anaconda lxml或者pip install lxml下载labelling到本地下载链接:https://github.com/tzutalin/labelImg(安装方法也参考自该链接)在准备放置labeling 的文件夹下打开git

2020-11-30 21:53:32 1784 5

原创 OpenCV灰度化之后图片为绿色

首先需要读图片,查看图片import cv2img_opencv = cv2.imread('C:/Users/20752/Desktop/GraduationProject/DogFace/DogFace/OpenSourceCrop_align/0/0.0.png')# BGR图片与平时看到的不太一样,因为是BGR个格式,平时看到的是RGB格式。之后转化为灰度图gray_img = cv2.cvtColor(img_opencv, cv2.COLOR_BGR2GRAY)##彩色图像转为灰

2020-11-29 19:43:11 3037 5

原创 创建新的python环境,安装 pytorch以及所其他项目所需要的包

1. 创建虚拟环境pytorch1创建一个叫做pytorch1的环境指令如下:conda create -n pytorch1 python=3.6之后,弹出提示,输入 y,即可安装安装成功后,输入以下指令:conda info --envs即可看到 conda 环境中,有新建的 pytorch1 环境2. 进入pytorch1 环境中,安装 pytorch使用如下指令,进入 pytorch1 环境conda activate pytorch1左边的 base 变成了 pytor

2020-11-28 15:37:22 4595 5

原创 SSIM计算

【代码】SSIM计算。

2023-12-05 09:24:07 121

原创 pip安装transformers报错Failed to build tokenizers ERROR: Could not build wheels for tokenizers,

这可能是因为它自动安装的版本不太合适,如果使用conda install -c huggingface transformers解决,会降低自己numpy等的版本,导致后续出现其他问题我在网上搜到一般使用3.4.0版本pip install transformers==3.4.0我的python是3.6的,可以解决然后可能会和自己使用的框架版本不匹配,我开始使用的是tensorflow2.6,和这个版本的transformers不匹配,后来改成2.3.1版本(从网上不知道哪搜的)的才可以pip

2022-04-26 17:20:19 14626 5

原创 不同虚拟环境下给不同版本的tensorflow装合适的cuda

conda install cudatoolkit==(后面跟版本),得去官网查tensorflow对应哪个版本的cudahttps://tensorflow.google.cn/install/source

2022-04-26 16:52:31 228

原创 安装libtiff3.6

如果安装了与python版本不符合的libtiff,就会:ERROR: pylibtiff-0.4.4-cp38-cp38-win_amd64.whl is not a supported wheel on this platform.如果是python3.6,就应该安装libtiff3.6,3.7,3.8以此类推可以去官网安装,3.6版本及以上安装pylibtiff...

2022-04-12 20:40:23 597

原创 tensorflow2到tensorflow1(不重新安装)

首先import tensorflow as tf改为import tensorflow.compat.v1 as tftf.disable_eager_execution()还有一些其他的如kernel_initializer = tf.contrib.layers.variance_scaling_initializer()改为kernel_initializer = tf.glorot_uniform_initializer()import tensorflow.contrib.s

2022-04-09 14:57:38 1872

原创 ERROR: Could not find a version that satisfies the requirement PIL (from versions: none) ERROR: No m

ERROR: Could not find a version that satisfies the requirement PIL (from versions: none)ERROR: No matching distribution found for PIL解决方案:pip install pillow

2022-04-02 09:27:25 3331

原创 mysqlNO CONNECTION ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost‘ (10061)

查看mysql服务是否启动,双击,调成自动、启动(管理员身份运行命令提示符)也可用命令行net start +mysql服务的名称连接

2021-12-28 13:58:51 402

原创 ModuleNotFoundError: No module named ‘win32api‘(The kernel has died, and the automatic restart ...)

The kernel has died, and the automatic restart has failed.查看报错原因:ModuleNotFoundError: No module named ‘win32api’解决方法:pip install pypiwin32

2021-10-29 12:19:47 469

原创 MindSpore安装

MindSpore安装(官网也有教程)创建虚拟环境conda create -n mindspore python=3.7.5进入虚拟环境conda activate mindspore来到MindSpore官网:https://www.mindspore.cn/install选择适合你的安装口令,我是win10,64位系统,是如下图这样选择的,获得的安装口令是:pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.3.

2021-10-28 21:58:33 1064 2

原创 SecureCRT中文乱码

SecureCRT中文乱码选中目标session点击Options,选择Session Options选择Appearance,选择UTF-8点击右下方OK

2020-12-11 21:50:10 118 1

原创 C++常用math函数

函数解释见代码注释:#include<stdio.h>#include<math.h>int main() { double a = -12.6; double b = 2.0, c = 3.0; const double pi = acos(-1.0);//cos(-1.0)=pi,所以用反余弦acos(-1.0)取pi的值 printf("%.1f\n", fabs(a));//绝对值 printf("%.0f %.0f\n", floor(a), ceil(a)

2020-12-02 14:58:46 992 2

原创 C++typedef

typedef给复杂冗长的数据类型起别名,在需要大量使用该复杂冗长的数据类型时可以提供方便比方用LL代替long long示例:#include<stdio.h>typedef long long LL;//给longlong起别名int main() { LL a = 123456767854432, b = 12345678545678; printf("%lld\n", a + b); return 0;}结果:参考文献:算法笔记...

2020-11-30 13:56:24 254 1

原创 C++输出格式%md、%0md、%.mf

%md不足m位的整型变量用空格在高位补齐,超过m位则保持原样示例:#include<stdio.h>int main(){ int a = 34, b = 123456; printf("%4d\n",a); printf("%4d\n",b); return 0;}结果:%0md与%md的区别是,高位不再是用空格补齐,而是用0补齐示例:#include<stdio.h>int main(){ int a = 34, b = 123456; pr

2020-11-30 13:40:09 727 1

原创 VSC++文件使用scanf报错C4996

如图所示:查阅官方文档得知:某些 C 运行时库函数被弃用,因为它们不安全,并且具有更安全的变体。 其他内容已被弃用,因为它们已过时。即已被弃用,如果非要用,可以用关闭警告的方式解决关闭文件中的警告若要在文件中关闭该警告,请使用警告杂注 #pragma warning(disable : 4996) 。在 Visual Studio 中关闭项目的警告若要在 Visual Studio IDE 中关闭整个项目的警告:打开项目的 "属性页" 对话框。 右键项目选择 “配置属性” " &

2020-11-30 13:05:32 441 1

原创 C++自增自减运算

自增运算符++,自减运算符–自增运算符有两种写法:i++,++i,它们的区别在于:i++是先使用i再将i加1++i是先把i加1在使用i示例:#include <stdio.h>int main() { int a = 1, b = 1, n1, n2; n1 = a++; n2 = ++b; printf("%d %d\n", n1, a); printf("%d %d\n", n2, b); return 0;}结果:如上图:n1=a++,n1先获得a的值,再

2020-11-29 21:46:23 518 1

原创 符号常量#define和const常量

符号常量#define用标识符代替常量,用法:#define 标识符 常量示例:#define pi 3.14#include <stdio.h>#define pi 3.14int main() { double r = 3; printf("%f/n", pi * r * r); return 0;}结果:const常量用法:const 数据类型 变量名 = 常量示例:const double pi = 3.14;#include <stdio.

2020-11-29 21:26:58 307 1

原创 VSC++项目有好几个程序中有main函数,报错main已经在xxx中定义

在文件上右键,之后点击属性选择是之后点击确定把除了当前要运行的文件之外的含main函数的都排除掉

2020-11-29 21:03:11 5789 2

原创 C++强制类型转换

(新类型名)变量名示例:#include <stdio.h>int main() { double r = 12.56; int a = 3, b = 5; printf("%d\n", (int)r); printf("%d\n", a / b);//两个int相除,结果为整数 printf("%.1f\n", (double)a / (double)b);//保留一位小数 printf("%.1f", (double)(a / b));//这种还是抹去了,相当于把a/b,

2020-11-29 20:53:34 114 1

原创 VScodeVuei18n自动翻译中英文生成索引

Vuei18n实现国际化网上有很多博文教程,在这篇博客想给大家安利一个自动翻译的插件,感觉自己手动翻译维护有一些麻烦在VScode中安装如下图所示插件即可实现快捷键Ctrl+.,注意点必须是英文的,之后就如下图:VUE文件中选择$t(“key”),JS文件中则选择i18n.t(‘key’)...

2020-11-29 16:34:40 1176 1

原创 ERROR: Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。: ‘D:\\anacanda\\1\\

ERROR: Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。: ‘D:\anacanda\1\envs\pytorch\Lib\site-packages\cv2\cv2.cp36-win_amd64.pyd’Consider using the --user option or check the permissions.在pip install 后面加上–user...

2020-11-28 17:28:34 305 1

原创 AttributeError: ‘NoneType‘ object has no attribute ‘shape‘

AttributeError: 'NoneType' object has no attribute 'shape'我遇到这个错,是因为图片路径没写对,仔细检查一遍路径,目录用“/”或者“\”隔开,如下图所示:

2020-11-28 14:55:04 326 1

torch-1.5.0+cu92-cp36-cp36m-win_amd64.whl等

torch-1.5.0+cu92-cp36-cp36m-win_amd64.whl和和torchvision-0.4.2+cu92-cp36-cp36m-win_和tensorflow-2.1.0-cp36-cp36m-win_amd64.whl

2020-11-29

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除