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

  • 相关阅读:
    2016012056+小学四则运算练习软件项目报告
    《构建之法》1,2,16章读后感
    我与软件
    散列函数的应用及其安全性
    EGener2四则运算出题器
    用jar包运行带GUI的java游戏
    关于《构建之法》第四章和第十七章的问题
    2016012070小学四则运算练习软件项目报告
    有关软件工程的一些问题
    300道随机四则运算小程序(java编写)
  • 原文地址:https://www.cnblogs.com/cxscode/p/8476966.html
Copyright © 2011-2022 走看看