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 empty. Adjust any of the aforementioned parameters.
问题描述:
在使用Unet++训练自己的数据集时出现ValueError: With n_samples=0, test_size=0.2 and train_size=None, the resulting train set will be empty. Adjust any of the aforementioned parameters.
原因分析:
原数据集训练图片使用的是png格式,自己的数据集图片为jpg格式。
解决方案:
将训练图片从jpg格式转成png格式。
import os
import cv2def transform(input_path, output_path):for root, dirs, files in os.walk(input_path):for name in files:file = os.path.join(root, name)print('transform' + name)im = cv2.imread(file)if output_path:cv2.imwrite(os.path.join(output_path, name.replace('jpg', 'png')), im)else:cv2.imwrite(file.replace('jpg', 'png'), im)if __name__ == '__main__':input_path = input("请输入目标文件夹: ")output_path = input("请输入输出文件夹: (回车则输出到原地址)")if not os.path.exists(input_path):print("文件夹不存在!")else:print("Start to transform!")transform(input_path, output_path)print("Transform end!")
ValueError With n_samples=0, test_size=0.2 and train_size=None, the resulting train set will be empt相关推荐
- 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.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 em ...
- 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 ...
- python报错 ValueError: dictionary update sequence element #0 has length 1; 2 is require
原文链接地址: https://blog.csdn.net/weixin_40894428/article/details/80683137 字符串转字典要用eval(),这个方法很多书上都没有介绍, ...
- 成功解决ValueError: min_samples_split must be an integer greater than 1 or a float in (0.0, 1.0]; got th
成功解决ValueError: min_samples_split must be an integer greater than 1 or a float in (0.0, 1.0]; got th ...
最新文章
- HVM guest配置文件
- 第3章 NFS基本应用
- 隐藏和伪装端口banner
- 关于自动驾驶的思考以及我准备做的事情
- linux(CentOs6)下jdk安装,mysql安装,tomcat安装,及web项目部署
- mysql trim 索引_mysql强大的trim()函数
- 删除win10自带的软件
- 我真的哭了,哭过后呢(-)
- jquery 入门与知识
- html怎么弄艺术字体,如何为图片加上艺术字的图文方法步骤
- 数据结构与算法-二叉树的名词概念与相关数据的计算
- HDU 1223 还是畅通工程(最小生成树prim模板)
- 【clickhouse】clickhouse 副本与分片 分片详解
- 网站导航(站点地图)
- 【NOIP初赛】【Luogu1787】普及组2013(洛谷初赛题提交水AC方法了解一下)
- Elasticsearch 实现自定义排序插件(转载)
- 云服务器真假辨别奥秘
- Silverlight 离线安装包
- 通用PHM集成开发环境PIDE
- 片袖原型制图_袖原型一片袖打版干货