ValueError: With n_samples=0, test_size=0.15 and train_size=None, the resulting train set will be em
ValueError: With n_samples=0, test_size=0.15 and train_size=None, the resulting train set will be empty. Adjust any of the aforementioned parameters.
错误原因:
看报错信息及目标文件目录可知,是生成数量为空,其实是因为文件路径不对
#这两处更改为你指定的路径
#一定要注意是path的末尾是否带上/,路径是拼接出来的,如果没有调整好,仍然会报上面的错误
labelme_path = "C:/Users/Administrator/Desktop/sss/" #原始labelme标注数据路径
saved_path = "C:/Users/Administrator/Desktop/ccc/" #保存路径
注意: 通过阅读源码
json_filename = labelme_path + json_file_ + ".json"
height, width, channels = cv2.imread(labelme_path + json_file_ +".jpg").shape
可知,我们转换的jpg图片和.json文件要放在同一个目录下:
然后又报错
Traceback (most recent call last):
File “json_to_xml.py”, line 28, in
json_file = json.load(open(json_filename,“r”,encoding=“utf-8”))
FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/Administrator/Desktop/sss/sss\\000000.json'
从报错信息来看,本以为是\的问题,其实不然,而是多了一个层级的目录
阅读源码
files = [i.split("/")[-1].split(".json")[0] for i in files] #其分割的是"/",而Windows返回路径为"\"
打印发现
for i in files:print(i.split("/")[-1])
故应该修改为
files = [i.split("\\")[-1].split(".json")[0] for i in files]
打印印证
for i in files:print(i.split("\\")[-1])
运行成功
ValueError: With n_samples=0, test_size=0.15 and train_size=None, the resulting train set will be em相关推荐
- ValueError: With n_samples=1, test_size=0.2 and train_size=None, the resulting train set will be
ValueError: With n_samples=1, test_size=0.2 and train_size=None, the resulting train set will be emp ...
- ValueError: With n_samples=1, test_size=0.2 and train_size=None, the resulting train set will be emp
原因:scikit-learn版本为0.20+,改为安装0.19.1 查看scikit-learn版本方法 python >>import sklearn >>sklearn. ...
- alueError: With n_samples=1, test_size=0.2 and train_size=None, the resulting train set will be
ValueError: With n_samples=1, test_size=0.2 and train_size=None, the resulting train set will be emp ...
- 成功解决ValueError: With n_samples=0, test_size=0.3 and train_size=None, the resulting train set will be
成功解决ValueError: With n_samples=0, test_size=0.3 and train_size=None, the resulting train set will be ...
- ValueError: With n_samples=0, test_size=0.2 and train_size=None, the resulting train set will be emp
今天写代码labelmetovoc,即将labelme标注的转化为voc标准格式参考的这篇文章时遇到了如下问题: ValueError: With n_samples=0, test_size=0.2 ...
- ValueError With n_samples=0, test_size=0.2 and train_size=None, the resulting train set will be empt
ValueError: With n_samples=0, test_size=0.2 and train_size=None, the resulting train set will be emp ...
- ValueError: With n_samples=0, test_size=0.3 and train_size=None, the resulting train set will be emp
ValueError: With n_samples=0, test_size=0.3 and train_size=None, the resulting train set will be emp ...
- 关于x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.3, random_state=0)
X_train,X_test, y_train, y_test =sklearn.model_selection.train_test_split(train_data,train_target,te ...
- python报错 ValueError: dictionary update sequence element #0 has length 1; 2 is require
原文链接地址: https://blog.csdn.net/weixin_40894428/article/details/80683137 字符串转字典要用eval(),这个方法很多书上都没有介绍, ...
最新文章
- getchar getche getch的区别
- Hyperledger Fabric 核心模块(4)orderer 共识
- 解决MVN install一直处于下载jar包等待问题
- [SDWC2018 Day1]网格
- LeetCode刷题(17)
- Dynamics CRM2016 Update or Create parentcustomerid in Contact using web api
- 通俗易懂的monteCarlo积分方法(八)
- UAC1.0和UAC2.0区别(八)
- java put请求_计算机毕业设计中用java实现小程序推送(springboot实现)
- rehat 出现GDB debuginfo-install 问题处理
- iOS:Tagged Pointer
- 【PHP代码审计】RIPS代码审计工具
- 关于使用NLPIR-ICTCLAS分词系统
- 阿里销售铁军:阿里巴巴客户跟进流程
- php5.3.3 xhprof,给CentOS6.3 + PHP5.3 安装PHP性能测试工具 XHProf-0.9.2
- 微信个人赞赏码怎么用?微信赞赏码使用教程详解
- ros服务器打开网页变慢了,解决ros 在计算机没有限速情况下,有几个网站打开很慢,或者打不开。...
- 重装系统后mysql不用重新安装
- 基于VNPY实现网格策略实盘(币圈)
- 阿里云服务器与本地不能复制粘贴
热门文章
- 游戏中提高抽卡概率外挂分析及原理
- 计算机鼠标左键不起作用,为什么电脑的左键点了不起作用
- 英特尔的指令集体系结构_INTEL 体系结构 MMX™ 技术开发者手册
- 打扰一下计算机房在哪里用英语怎么写,打扰用英语怎么说例句翻译
- 对未来的打算和本专业的认识
- 看完代码回首看论文:YOLOv3重读
- oracle 10231事件,Oracle数据块损坏篇之10231内部事件
- rtx3060ti参数配置
- python sendkeys用法_selenium sendkeys方法总结
- An internal error occurred during: Add Deployment.