zoukankan      html  css  js  c++  java
  • 机器学习之猫狗大战,解决image RGB values must be in the 0..1 range.

     猫狗大战是比较经典的机器学习案例,前几天体验了一番,来记录一下

    1.图片准备

    首先是准备训练的图片

    链接:https://pan.baidu.com/s/1ht1HIuw 密码:aw9s

     

    2.开始训练

    需要的时间可能比较长

    注:可能出现image RGB values must be in the 0..1 range.的错误

    可以尝试修改下面的代码,将img[j,:,:,:]数组的值调到0到1之间,

    0.1 * old_img + 0.5 对图片显示影响较小,不过可能会偏移;

    0.2 * abs(old_img)对图片位置影响较小,不过可能显示会失真。

    可参考:https://stackoverflow.com/questions/47318871/valueerror-floating-point-image-rgb-values-must-be-in-the-0-1-range-while-usi

    3.测试训练

    再找几张猫狗图片进行测试

    test.py

    参考:

    TensorFlow——训练自己的数据(一)数据处理:http://blog.csdn.net/xinyu3307/article/details/74643019
    TensorFlow——训练自己的数据(二)模型设计:http://blog.csdn.net/xinyu3307/article/details/74943033
    TensorFlow——训练自己的数据(三)模型训练:http://blog.csdn.net/xinyu3307/article/details/74979842
    TensorFlow——训练自己的数据(四)模型测试:http://blog.csdn.net/xinyu3307/article/details/75008458

    用自己的图片数据做tensorflow深度学习:http://blog.csdn.net/baidu_23263735/article/details/74177831
    github地址:https://github.com/kevin28520/My-TensorFlow-tutorials/tree/master/01%20cats%20vs%20dogs

  • 相关阅读:
    jQuery Easing 动画效果扩展
    【百度地图】标注点的动画效果
    CSS3制作404立体字体
    最长上升子序列的回溯 ZOJ 2432
    HDU 1423 最长上升公共子序列(LCIS)
    HDU 1114 完全背包问题的转化
    HDU 1085 多重背包转化为0-1背包问题
    opengl 对投影变化函数的理解
    HDU 1081 DP找最大和的矩阵
    HDU 1274 递归拼接字符串
  • 原文地址:https://www.cnblogs.com/cxscode/p/8476966.html
Copyright © 2011-2022 走看看