python
Lostboy船长
只要思想不滑坡,方法总比困难多。进来看我博客的朋友,都是对知识有所渴望的,
希望我的分享的内容对你有所帮助。
展开
-
python 学习笔记一
# 输出第一句print("hello World!")'''这是一句注释'''name ="jason"age =18print(name)print(age)'''数组===================================='''list =[1,2,3,4,5,213]print(list[1:4])'''元组=================='''t原创 2017-06-17 12:41:28 · 490 阅读 · 0 评论 -
cat dog
import tensorflow as tfimport numpy as npimport osimport mathdef get_files(file_dir, ratio): ''''' Args: file_dir: file directory Returns: list of images and labels ...原创 2018-05-17 10:36:59 · 211 阅读 · 0 评论 -
python create img
#coding:utf-8from captcha.image import ImageCaptcha # pip install captchaimport numpy as npimport matplotlib.pyplot as pltfrom PIL import Imageimport random,time# 验证码中的字符, 就不用汉字了number = ['0...原创 2018-05-17 13:38:19 · 1325 阅读 · 0 评论 -
tensorflow save and restore
# 本文件程序为配合教材及学习进度渐进进行,请按照注释分段执行 # 执行时要注意IDE的当前工作过路径,最好每段重启控制器一次,输出结果更准确 # Part1: 通过tf.train.Saver类实现保存和载入神经网络模型 # 执行本段程序时注意当前的工作路径 import tensorflow as tf v1 = tf.Variable(tf.constant(1.0...原创 2018-05-17 15:36:21 · 140 阅读 · 0 评论 -
python 随写笔记
import tensorflow as tfimport osimport numpy as npos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'# case 2def test(): input = tf.Variable(tf.random_normal([1, 3, 3, 5])) filter = tf.Variable(tf...原创 2018-05-17 18:12:27 · 170 阅读 · 0 评论 -
python imgtotfrecord
import tensorflow as tfimport globfrom itertools import groupbyfrom collections import defaultdictfrom PIL import Imageimport numpy as np# 将满足目录的所有.jpg文件的路径放置在image_filenames列表中# image_filenam...原创 2018-05-11 13:49:34 · 214 阅读 · 0 评论 -
ckpt2pb
import tensorflow as tfimport os.pathimport argparsefrom tensorflow.python.framework import graph_utilMODEL_DIR = "E:/imageDS/catDog/backup/"MODEL_NAME = "frozen_model.pb"if not tf.gfile.Exist...原创 2018-05-15 13:26:05 · 413 阅读 · 0 评论