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相关推荐

  1. 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 ...

  2. 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. ...

  3. 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 ...

  4. 成功解决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 ...

  5. 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 ...

  6. 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 ...

  7. 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 ...

  8. python报错 ValueError: dictionary update sequence element #0 has length 1; 2 is require

    原文链接地址: https://blog.csdn.net/weixin_40894428/article/details/80683137 字符串转字典要用eval(),这个方法很多书上都没有介绍, ...

  9. 成功解决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 ...

最新文章

  1. HVM guest配置文件
  2. 第3章 NFS基本应用
  3. 隐藏和伪装端口banner
  4. 关于自动驾驶的思考以及我准备做的事情
  5. linux(CentOs6)下jdk安装,mysql安装,tomcat安装,及web项目部署
  6. mysql trim 索引_mysql强大的trim()函数
  7. 删除win10自带的软件
  8. 我真的哭了,哭过后呢(-)
  9. jquery 入门与知识
  10. html怎么弄艺术字体,如何为图片加上艺术字的图文方法步骤
  11. 数据结构与算法-二叉树的名词概念与相关数据的计算
  12. HDU 1223 还是畅通工程(最小生成树prim模板)
  13. 【clickhouse】clickhouse 副本与分片 分片详解
  14. 网站导航(站点地图)
  15. 【NOIP初赛】【Luogu1787】普及组2013(洛谷初赛题提交水AC方法了解一下)
  16. Elasticsearch 实现自定义排序插件(转载)
  17. 云服务器真假辨别奥秘
  18. Silverlight 离线安装包
  19. 通用PHM集成开发环境PIDE
  20. 片袖原型制图_袖原型一片袖打版干货

热门文章

  1. 微信公众平台开发__导航
  2. 地球上20张最惊人的照片_地球上30个惊人的自然景点
  3. 思维误区:努力学习与有效学习!不要做无用功
  4. android P OTA 初探 —— 1、OTA简单介绍
  5. 转载linux一句话精彩问答
  6. 程序员搞笑段子锦集,内容太过真实,默默留下了感慨的泪水!
  7. 个人工作总结与业绩报告
  8. HAUT 1262 魔法宝石 (最短路变形 or 暴力)
  9. 洛谷P2698 Flowerpot S
  10. 会员金闪闪动画字体 (CATextLayer + CAGradientLayer)