自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(18)
  • 收藏
  • 关注

原创 【无标题】

import cv2。

2023-08-23 20:00:51 84 1

原创 pip install python-Levenshtein导入报错

pip install python-Levenshtein导入报错解决办法:去pip的网址直接下载相关whl包,直接安装官网链接:https://www.lfd.uci.edu/~gohlke/pythonlibs/#python-levenshtein官网链接下载时注意自己电脑版本下载后操作方式如下:pip install whl包的位置...

2021-10-31 21:12:06 746

原创 python中import上级sys.path.append(‘..‘) 失效

import sysimport argparseimport timesys.path.append('..')import MPIIFolderimport Mytransforms报错:找不到MPIIFolder包(此包在上级目录),将sys.path.append(’…’)语句进行替换,如下import sysimport argparseimport time# sys.path.append('..')dir_path = os.path.dirname(os.pa

2021-08-22 20:23:05 5770 1

原创 ‘int‘ object has no attribute ‘val‘

剑指offer刷题遇到1 题目:输入一个链表,输出一个链表,该输出链表包含原链表中从倒数第k个结点至尾节点的全部节点。如果该链表长度小于k,请返回一个长度为 0 的链表。2 源码# class ListNode:# def __init__(self, x):# self.val = x# self.next = None## 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可## # @param pHead ListN

2021-07-25 16:32:05 2213

原创 list index out of range错误

这个问题是刷剑指offer遇到的,造成此问题的原因存在以下两种:1 list[index] index超出范围2 list为空,执行list[0]就会报错题目:输入两个整数序列,第一个序列表示栈的压入顺序,请判断第二个序列是否可能为该栈的弹出顺序。假设压入栈的所有数字均不相等。例如序列1,2,3,4,5是某栈的压入顺序,序列4,5,3,2,1是该压栈序列对应的一个弹出序列,但4,3,5,1,2就不可能是该压栈序列的弹出序列。(注意:这两个序列的长度是相等的)原代码class Solutio

2021-07-17 22:17:07 4667 1

原创 python安装包出现WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None))

python安装包报错WARNING原因:Anaconda镜像源出了问题造成上述原因的情况1 :开vpn了(这就是我存在的问题),关掉就可以解决了。2 :镜像源需要更换,可参考下面链接的操作方法更改Anaconda镜像源:修改Anaconda镜像源方法...

2021-07-01 17:22:05 568

原创 list assignment index out of range

list assignment index out of rangeimport numpy as npimport ospaths = []img_path='work/PaddleDetection/dataset/mot/MOT17/images/test/MOT17-01-SDP/img1/'img_list=sorted(os.listdir(img_path))#文件名按字母排序paths[0] = img_path+img_list[0]print(paths[0])报错以

2021-06-20 17:32:58 150

原创 ValueError: not enough values to unpack (expected 2, got 1)

fh.write(str(valid_data[i][0])+' '+str(valid_data[i][1])+'\n')生成txt文件时,空格字符是手打的,在读取此txt文件时报错,ValueError: not enough values to unpack (expected 2, got 1)fh.write(str(valid_data[i][0])+'\t'+str(valid_data[i][1])+'\n')代码将手打空格换成‘\t’用字符代替解决问题...

2021-06-02 16:12:54 138

原创 RuntimeError: asyncio.run() cannot be called from a running event loop

学习协程异步操作出现的问题import asyncioimport timeasync def func_4(): print("营养快线") # time.sleep(3) # print("娃哈哈")if __name__=='__main__': g = func_4() # 此时的函数是异步协程函数,此时函数执行得到一个协程对象 asyncio.run(g)代码报错:RuntimeError: asyncio.run() cannot be

2021-05-15 15:28:07 6552 1

原创 服务器渲染和客户端渲染的区别

服务器渲染在服务器端直接将数据和 html进行整合,统一返还给浏览器特点:在页面源代码中能看到数据客户端渲染第一次请求只要一个html骨架,第二次请求拿到数据,在客户端整合特点:在页面源代码中看不到数据...

2021-05-09 19:49:06 101

原创 PaddleDetection断点续训

!python -u tools/train.py -c configs/yolov3_mobilenet_v1_voc.yml -r output/yolov3_mobilenet_v1_voc/16600 --use_vdl True --eval可以通过命令行tools/train.py设置参数,其中的-o参数可以覆盖设置配置文件里的参数。tools/train.py训练参数列表 以下列表可以通过–help查看官方文档链接:PaddleDetection.个人百度大脑链接:AIStudio.

2021-04-16 13:21:42 1439

原创 AttributeError: module ‘numpy.random‘ has no attribute ‘default_rng‘

AttributeError: module ‘numpy.random’ has no attribute ‘default_rng’执行以下代码from gensim import corpora, models, similaritiesimport gensim报错 61 #: A default, shared numpy-Generator-based PRNG for any/all uses that don't require seeding---> 62 de

2021-04-01 22:16:22 12552 8

原创 AttributeError: ‘dict_items‘ object has no attribute ‘copy‘

AttributeError: ‘dict_items’ object has no attribute ‘copy’# 迭代次数,对于分类问题,每个类别的迭代次数,所以总的基学习器的个数 = 迭代次数*类别个数num_rounds = 50model = xgb.train(plst, dtrain, num_rounds) # xgboost模型训练xgboost中的plst参数定义更改原plst = params.items()更新为plst = list(params.items

2021-03-27 14:05:15 716

原创 2021-03-24

python读取xml文件固定标签,并写入txt文件# 读取XML文件里的图片标签import xml.dom.minidomclass TXT_W: def __init__(self,path,paths_name): self.path = path self.paths_name = paths_name def __call__(self): try: fh = open(self.path, "w"

2021-03-24 21:32:04 57

原创 python通过异常处理,写入txt文件

python通过异常处理,写入txt文件#通过异常处理,写入文件try: fh = open("data/data69612/tran.txt", "w") for i in range(len(paths_train)): if 'xxx' in paths_train[i]: #判断字符串xxx是否在paths_train[i]中 fh.write(paths_train[i]+' '+'0'+'\n') if 'xx' i

2021-03-24 21:26:16 304

原创 读取文件下所有固定格式,如jpg、xml

读取文件下所有固定格式,如jpg、xml# 读取文件夹下所有图片链接,并存入列表import globimport ospaths = []def walk_type(path, file_type): paths = glob.glob(os.path.join(path,#存放图片的文件夹路径 file_type # 文件类型,*代表所有文件 )

2021-03-24 21:19:37 108

原创 AttributeError: ‘Series’ object has no attribute ‘as_matrix’

AttributeError: ‘Series’ object has no attribute ‘as_matrix’# 展示单条数据n = 14 # n为数据在表格中的索引 image_name = key_pts_frame.iloc[n, 0] # 获取图像名称key_pts = key_pts_frame.iloc[n, 1:].as_matrix() # 将图像label格式转为numpy.array的格式key_pts = key_pts.astype('float').resha

2021-03-23 17:08:02 1322 1

原创 ValueError:Expected 2D array, got 1D array instead:

使用sklearn报错ValueError:Expected 2D array, got 1D array instead:clf.predict([4.4, 3.2, 1.3, 0.2])ValueError: Expected 2D array, got 1D array instead:array=[4.4 3.2 1.3 0.2].Reshape your data either using array.reshape(-1, 1) if your data has a singl

2021-03-23 16:00:52 925

空空如也

空空如也

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

TA关注的人

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