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

  • 相关阅读:
    os 模块
    time-时间模块
    hashlibloggingconfigparser
    模块-json,pickle
    转载:执行脚本出现bin/bash: bad interpreter: No such file or directory
    转载:如何查看用户当前shell和修改用户登陆时的默认shell
    转载:对#!/bin/sh的认识
    转载:mysql-Auto_increment值修改
    转载:Tomcat多数据源配置方法
    转载:struts2和spring的结合原理(精品)
  • 原文地址:https://www.cnblogs.com/cxscode/p/8476966.html
Copyright © 2011-2022 走看看