自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

小呆丶的博客

没有人可以随随便便成功丶

  • 博客(85)
  • 收藏
  • 关注

原创 1251-Client does not support authentication protocol requested by server

报错:Naticat11.1.13版本连接mysql8.0遇到报错:1251-Client does not support authentication protocol requested by server原因:使用MySQL客户端Navicat连接数据库MySQL8.0,MySQL8.0之前的版本中加密规则是mysql_native_password,而MySQL8.0,加密规...

2021-05-12 11:15:00 227

原创 TypeError: <flask_script.commands.Command object at 0x00000201F36629E8>: option values must be strin...

输入命令 python manage.py db migrate报错:TypeError: <flask_script.commands.Command object at 0x00000201F36629E8>: option values must be strings是由于SQLALCHEMY_DATABASE_URI写错了,检测拼写。...

2020-03-03 17:19:00 419

原创 Flask启动时报错:ValueError: urls must start with a leading slash

启动flask时报错:ValueError: urls must start with a leading slash错误代码:bp = Blueprint('cms',__name__,subdomain='cms',url_prefix='cms')正确代码:bp = Blueprint('cms',__name__,subdomain='cms',url_pre...

2020-02-20 17:11:00 471

原创 {TypeError}__init__() takes from 1 to 2 positional arguments but 3 were given

错误代码:class RegistForm(Form): deposit = FloatField(validators=[InputRequired])解决方法:将InputRequired改为InputRequired()即可正确代码:class RegistForm(Form): deposit = FloatField(validators=[...

2020-02-01 21:31:00 1867

原创 Warning | 3719 | 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias fo...

MySQL的“utf8”实际上不是真正的UTF-8。“utf8”只支持每个字符最多三个字节,而真正的UTF-8是每个字符最多四个字节。MySQL一直没有修复这个bug,他们在2010年发布了一个叫作“utf8mb4”的字符集,绕过了这个问题。简单概况:MySQL的“utf8mb4”是真正的“UTF-8”。MySQL的“utf8”是一种“专属的编码”,它能够编码的Unicod...

2019-12-17 15:36:00 4533

原创 sqlalchemy.exc.CompileError: (in table 'user', column 'username'): VARCHAR requires a length on dial...

映射数据库时报错:sqlalchemy.exc.CompileError: (in table 'user', column 'username'): VARCHAR requires a length on dialect mysql错误代码:username = db.Column(db.String)String需要指定长度,如:username = db.Colum...

2019-12-03 18:22:00 1924

原创 TypeError: not all arguments converted during string formatting

报错:TypeError: not all arguments converted during string formatting错误原因:%s前后的参数数量不对应。有n个字段,就要有n个%s

2019-12-03 17:12:00 429

原创 Flask笔记(一)

first_flask_project.py# 从flask这个包中导入Flask这个类# Flask这个类是项目的核心,以后很多操作都是基于这个类的对象# 注册url、注册蓝图等都是基于这个类的对象from flask import Flask# 创建一个Flask对象,传递__name__参数进去# __name__参数的作用:# 1. 可以规定模版和静态文件的查找路...

2019-10-31 10:09:00 193

原创 python-----图像去重(imagededup)

安装库:pip install imagededup安装可能遇到的问题参考:Cannot uninstall 'wrapt'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to ...

2019-10-10 11:05:00 1204

原创 {RuntimeError} An attempt has been made to start a new process before the current process has finish...

加载数据时出现报错:RuntimeError:An attempt has been made to start a new process before thecurrent process has finished its bootstrapping phase.This probably means that you are...

2019-10-10 10:57:00 1631

原创 ERROR: Cannot uninstall 'wrapt'. It is a distutils installed project and thus we cannot accurately d...

pip install imagededup 时,报错:Cannot uninstall 'wrapt'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial unins...

2019-10-10 10:52:00 1569 1

原创 报错:ipython 6.5.0 has requirement prompt-toolkit<2.0.0,>=1.0.15, but you'll have prompt-toolkit 2.0.1...

pip install imagededup 时,报错:ipython 6.5.0 has requirement prompt-toolkit<2.0.0,>=1.0.15, but you'll have prompt-toolkit 2.0.15 which is incompatible.原因: setuptools 版本太高解决方法:conda in...

2019-10-10 10:47:00 2206

原创 python-----opencv图像边界扩充

在对图片进行卷积处理的时候,如果卷积模版(卷积内核)过大,且不对原图的边界进行扩充,会导致处理之后得到的图片尺寸变的很小,也就是严重失真。而扩充边界有多种方法,本文就介绍一下这些填充方法。这是原始图像。根据图像的边界的像素值,向外扩充图片,每个方向扩充50个像素。a = cv2.copyMakeBorder(img,5...

2019-09-26 11:41:00 641

原创 读取xml时,报错:xml.etree.ElementTree.ParseError: no element found: line 20, column 9

读取xml时,出现报错:xml.etree.ElementTree.ParseError: no element found: line 20, column 9原因是xml文件格式有问题,可以检查一下出问题的xml文件

2019-09-11 15:45:00 11146 5

原创 python-----opencv截取按帧截取视频

最近有需求把一个视频从指定帧截取一部分,demo代码如下:import cv2video_path = r'F:\temp\temp_0806\1\video\test.dat'videoCapture = cv2.VideoCapture(video_path)fps = 16 # 保存视频的帧率size = (1280, 720) # 保存视频的大小...

2019-08-13 17:17:00 797

原创 激活Win10内置版Linux (ubuntu)

微软自从14316版本后,就开始原生支持Linux Bash命令行。1.首先到系统设置——更新和安全——针对开发人员——选择开发者模式。2.控制面板→程序和功能→启用或关闭Windows功能,勾选“适用于Linux的Windows子系统(Beta)"***安装后需要重启3.打开命令提示符,直接在管理员模式下输入Bash命令,提示需要从windows stor...

2019-08-13 17:12:00 539

原创 python-----is和==的区别

Python中有很多运算符,今天我们就来讲讲is和==两种运算符在应用上的本质区别是什么。在讲is和==这两种运算符区别之前,首先要知道Python中对象包含的三个基本要素,分别是:id(身份标识)、type(数据类型)和value(值)。is和==都是对对象进行比较判断作用的,但对对象比较判断的内容并不相同。下面来看看具体区别在哪。==比较操作符和is同一性运算符区别...

2019-07-30 17:54:00 105

原创 python-----正则表达式笔记

正则表达式和re模块:什么是正则表达式:通俗理解:按照一定的规则,从某个字符串中匹配出想要的数据。这个规则就是正则表达式。标准答案:https://baike.baidu.com/item/正则表达式/1700215?fr=aladdin正则表达式常用匹配规则:匹配某个字符串:#!/usr/bin/env python# -*- coding: utf-8 -*-import re...

2019-07-22 19:08:00 108

原创 python-----多线程笔记

多进程笔记:多线程介绍:多线程是为了同步完成多项任务,通过提高资源使用效率来提高系统的效率。线程是在同一时间需要完成多项任务的时候实现的。最简单的比喻多线程就像火车的每一节车厢,而进程则是火车。车厢离开火车是无法跑动的,同理火车也可以有多节车厢。多线程的出现就是为了提高效率。同时它的出现也带来了一些问题。更多介绍请参考:https://baike.baidu.com/item/多线程/119...

2019-07-20 15:42:00 103

原创 python-----多进程笔记

多进程笔记:在Python中多进程的创建方式对比:1.在Python中,可以通过os.fork()创建子进程,但是这种方式智能在'linux'和'unix'以及'mac'下面使用,不能跨平台,所以一般不推荐使用这种方式。2.使用'multiprocessing'模块也可以创建多进程,并且这种方式在写起来更加简单,并且支持跨平台,所以一般推荐使用'multiprocessing'的方式来写多...

2019-07-20 15:41:00 97

原创 python-----批量操作xml文件(新建、增、删、改、查)

最近需要处理xml文件,学习并整理了一些常用的操作,代码如下:#!/usr/bin/env python# -*- coding: utf-8 -*-# @Time : 2019/7/9 15:16# @Author : xiaodaiimport xml.etree.ElementTree as ETfrom lxml import etreefrom t...

2019-07-09 18:44:00 1653

原创 python-----将图片与标注的xml坐标水平翻转

我们做机器学习的时候,总会用到很多训练集,然后我们的数据比较少的时候,就可以将图片翻转标注。代码如下:#!/usr/bin/env python# -*- coding: utf-8 -*-# @Time : 2019/6/28 13:59# @Author : xiaodaiimport cv2from PIL import Imageimport xml...

2019-07-08 20:38:00 1423 2

原创 python-----图片保存为视频

#!/usr/bin/env python# -*- coding: utf-8 -*-# @Time : 2019/7/2 13:32# @Author : xiaodai# -*- coding: UTF-8 -*-import osimport cv2from tqdm import tqdmfrom multiprocessing import ...

2019-07-02 16:41:00 587

原创 python-----操作路径

分离路径、文件名org_path = r"F:\temp\test"fpath, fname = os.path.split(org_path)print(fpath,fname)# F:\temp test拼接路径org_path = r"F:\temp\test"for f in os.listdir(org_path): f_path ...

2019-07-02 16:21:00 103

原创 使用Pycharm官方统计代码行插件统计代码总行数

使用Pycharm官方统计代码行插件统计代码总行数 最近有需求,需要统计项目代码的总行数,首先想到了使用Pycharm官方的统计行数插件,发现效果还不错。官方代码统计插件指导:https://plugins.jetbrains.com/plugin/4509-statisticps:该插件需要Java1.8环境变量支持...

2019-06-14 10:59:00 11372 2

原创 ImportError: No module named 'httplib'

ImportError: No module named 'httplib' 原因:Python 2.x中的"httplib"模块在Python 3.x中变成了"http.client"原代码:import httplibimport urllibreqheaders={'MobileType':'Android',...

2019-05-28 15:54:00 6031 1

原创 python 包 Unofficial Windows Binaries for Python Extension Packages

python 包 Unofficial Windows Binaries for Python Extension Packages 链接:https://www.lfd.uci.edu/~gohlke/pythonlibs/ posted @ 2019-05-28 15:46 小呆丶 阅...

2019-05-28 15:46:00 244

原创 使用Navicat连接MySQL出现1251错误

使用Navicat连接MySQL出现1251错误 问题:navicat连接mysql时报错:1251-Client does not support authentication protocol requested by server; consider upgrading MySQL client解决方法:打开mysql输入以下命名:...

2019-05-28 15:40:00 10077 5

原创 elasticsearch-head的使用

elasticsearch-head的使用 elasticsearch-head下载地址:  链接:https://pan.baidu.com/s/1PWtMGUMTiUaX5sIt5z82BQ   提取码:w8k6 1、进入elasticsearch-head的文件夹,如:D:\Program Files\elasticsearch-he...

2019-05-21 13:21:00 98

原创 python-----windows下安装face_recognition库

python-----windows下安装face_recognition库 如果直接在cmd命令界面 输入:pip installface_recognition 如下图所示:如果第一次就会出现一系列的问题,解决此问题就安装如下步骤:一、如果你本机没有安装vistual studio,就先下载安装,我下载的是目前最新版本:...

2019-04-14 01:16:00 1403

原创 TypeError: can't convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory fi...

TypeError: can't convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first. 报错原因:numpy不能读取CUDA tensor 需要将它转化为 CPU tensor。所以如果想把CUDA tensor格式的数据改...

2019-04-09 15:46:00 1539

原创 python-----实现print不换行

python-----实现print不换行 python中print输出是默认换行的,那如何我们不想换行,且需要用多个print函数输出时,就需要改变print默认换行的属性:例:print('Hello')print('!')输出结果为:Hello!其实默认的属性是end='\n',只不过平时将其省...

2019-03-20 15:24:00 1285

原创 python-----删除列表中某个元素的3种方法

python-----删除列表中某个元素的3种方法 python中关于删除list中的某个元素,一般有三种方法:remove、pop、del:1.remove: 删除单个元素,删除首个符合条件的元素,按值删除举例说明:>>> str=[1,2,3,4,5,2,6]>>> str.remove(2)...

2019-03-20 14:57:00 18963

原创 AttributeError: 'str' object has no attribute 'decode'

AttributeError: 'str' object has no attribute 'decode' 错误代码:name = student['name'].decode("gbk")解决办法:把后面的 .decode("gbk") 删除即可 post...

2019-03-20 13:51:00 383

原创 python-----从本地摄像头和网络摄像头截取图片

python-----从本地摄像头和网络摄像头截取图片 import cv2# 获取本地摄像头# folder_path 截取图片的存储目录def get_img_from_camera_local(folder_path): cap = cv2.VideoCapture(0) i = 1 whil...

2019-03-05 09:35:00 2439

原创 python-----flask项目端口设置无效

python-----flask项目端口设置无效 最近在做flask项目时发现了一个问题,在项目里写: app.run(host='0.0.0.0',port=9000)但启动时,还是使用5000端口启动的。后来经过测试,解决方法有两个:如果启动时是 FLASK_ENV = development方法一:调...

2019-03-02 13:25:00 2550

原创 js-----博客园鼠标特效,跟随鼠标移动线条

js-----博客园鼠标特效,跟随鼠标移动线条 把以下代码放到页脚Html代码(设置---&gt;页脚Html代码)里。如下图:&lt;script&gt; !function(){ function n(n,e,t){ return n.getAttribute(e)||t } ...

2019-02-28 10:23:00 2363

原创 js-----博客园鼠标点击特效

js-----博客园鼠标点击特效 把以下代码放到页首Html代码里,或者页脚Html代码(设置---&gt;页首/脚Html代码)里。如下图:&lt;script type="text/javascript"&gt;/* 鼠标特效 */var a_idx = 0;jQuery(document).ready(funct...

2019-02-28 10:11:00 2421

原创 python-----贴图 和 报错:OSError: image file is truncated (8 bytes not processed)的处理

python-----贴图 和 报错:OSError: image file is truncated (8 bytes not processed)的处理 将一张图片贴到另一张图片上,代码如下:from PIL import Imageimport osfrom PIL import ImageFileImageFile.LO...

2019-02-27 13:33:00 5994

原创 ImportError: libQtTest.so.4: cannot open shared

ImportError: libQtTest.so.4: cannot open shared 错误:import cv2 File "/usr/local/lib/python3.5/dist-packages/cv2/__init__.py", line 3, in &lt;module&gt; from .cv2 im...

2019-02-26 10:50:00 3043

空空如也

空空如也

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

TA关注的人

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