![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
tensorflow
魇餍
你若盛开,蝴蝶自来
展开
-
tensorflow 保存训练模型ckpt 查看ckpt文件中的变量名和对应值
添加链接描述原创 2020-01-15 12:58:40 · 698 阅读 · 0 评论 -
Tensorflow模型的保存和加载
模型的保存 import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data # 载入数据集 mnist = input_data.read_data_sets("MNIST_data", one_hot=True) # 每个批次的大小 batch_size = 100 # 计算一共有多少个批次...原创 2018-03-01 18:30:46 · 189 阅读 · 0 评论 -
Tensorflow加载goodle的inception-v3模型
import tensorflow as tf import os import tarfile import requests # inception模型下载地址 inception_pretrain_module_url = 'http://download.tensorflow.org/models/image/imagenet/inception-2015-12-05.tgz' # 模...原创 2018-03-01 23:04:19 · 779 阅读 · 1 评论 -
使用inception-v3实现各种图像的识别
import tensorflow as tf import os import numpy as np import re from PIL import Image import matplotlib.pyplot as plt class NodeLookup(object): def __init__(self): label_lookup_path = 'in...原创 2018-03-02 13:01:32 · 2279 阅读 · 0 评论 -
tensorflow 通道的组合
import tensorflow as tf a = tf.Variable([ [[1, 1, 1], [1, 1, 1]], [[2, 2, 2], [2, 2, 2]] ]) b = tf.Variable([ [[3, 3, 3], [3, 3, 3]], [[4, 4, 4], [4, 4, 4]] ...原创 2018-03-13 15:34:33 · 1890 阅读 · 0 评论 -
cifar10 卷积
import cifar10_input import tensorflow as tf import numpy as np batch_size = 128 data_dir = 'cifar-10-batches-bin' print('begin') images_train, labels_train = cifar10_input.inputs(eval_data=False, da...原创 2018-04-11 17:45:44 · 353 阅读 · 0 评论 -
tensorflow保存读取TFRecords文件
Convert data to features def _int64_feature(value): return tf.train.Feature(int64_list=tf.train.Int64List(value=[value])) def _bytes_feature(value): return tf.train.Feature(bytes_list=tf.train...原创 2018-05-07 18:42:43 · 352 阅读 · 0 评论 -
tensorflow读取tfRecords文件,可批量读取,双输入
保存 import glob import cv2 import numpy as np import tensorflow as tf import sys # A function to Load images def load_image(addr): # read an image and resize to (224, 224) # cv2 load image...原创 2018-05-25 17:44:26 · 2166 阅读 · 0 评论 -
安装tensorflow-gpu杂项
使用pip的时候在后面加上-i参数,指定pip的下载源 pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple cuda8.0安装 1)在终端运行指令 sudo sh cuda_8.0.27_linux.run 选择 Do you accept the previously read EULA? accept/dec...原创 2018-07-02 15:19:20 · 290 阅读 · 0 评论 -
SPP
原创 2018-11-21 18:32:43 · 841 阅读 · 0 评论 -
递归神经网络RNN
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data # 载入数据 mnist = input_data.read_data_sets('MNIST_data', one_hot=True) # 输入图片是28*28 n_inputs = 28 # 输入一行,一行有28个数据 ma...原创 2018-03-01 17:51:55 · 738 阅读 · 0 评论 -
卷积神经网络应用于MNIST数据集分类
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('MNIST_data', one_hot=True) # 每个批次的大小 batch_size = 100 # 计算一共有多少个批次 n_batch = mnis...原创 2018-03-01 17:42:53 · 2355 阅读 · 0 评论 -
Tensorflow可视化
# coding: utf-8 import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data from tensorflow.contrib.tensorboard.plugins import projector #载入数据集 mnist = input_data.read_data_se...原创 2018-03-01 13:30:51 · 401 阅读 · 0 评论 -
变量的使用
# 导入tensorflow模块 import tensorflow as tf # 定义一个变量,类型是一个一维列表 x = tf.Variable([1, 2]) # 定义一个常量,类型时一个一维列表 a = tf.constant([3, 3]) # 减法操作 sub = tf.subtract(x, a) #初始化变量 init = tf.global_variables_initiali...原创 2018-02-26 16:19:06 · 157 阅读 · 0 评论 -
从1加到10
# 导入tensorflow模块 import tensorflow as tf # 定义变量 state = tf.Variable(0) # 定义加法 new_value = tf.add(state, 1) # 更新变量 update = tf.assign(state, new_value) # 初始化变量 init = tf.global_variables_initializer() ...原创 2018-02-26 16:36:49 · 1983 阅读 · 1 评论 -
Fetch and Feed
import tensorflow as tf # Fetch input1 = tf.constant(2) input2 = tf.constant(3) input3 = tf.constant(4) add = tf.add(input1, input2) # 点乘 mul = tf.multiply(add, input3) with tf.Session() as sess: ...原创 2018-02-26 16:56:13 · 180 阅读 · 0 评论 -
Tensorflow的一个简单实例,线性回归
# 导入模块tensorflow,numpy import tensorflow as tf import numpy as np # 构建一个线性模型 x_data = np.random.rand(100) y_data = x_data * 0.1 + 0.1 b = tf.Variable(0.) k = tf.Variable(0.) y = k * x_data + b # 二次代价...原创 2018-02-26 17:21:03 · 295 阅读 · 0 评论 -
神经网络实现非线性回归
import tensorflow as tf import numpy as np import matplotlib.pyplot as plt # 使用numpy生成200个随机点 x_data = np.linspace(-0.5, 0.5, 200)[:, np.newaxis] noise = np.random.normal(0, 0.02, x_data.shape) y_dat...原创 2018-02-27 14:43:01 · 5297 阅读 · 1 评论 -
MNIST数据集简单版本
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data # 载入数据集 mnist = input_data.read_data_sets("MNIST_data", one_hot=True) # 每个批次的大小 batch_size = 100 # 计算一共有多少个批次 n_batc...原创 2018-02-27 15:13:33 · 556 阅读 · 1 评论 -
MNIST复杂版本
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data # 载入数据集 mnist = input_data.read_data_sets("MNIST_data", one_hot=True) # 每个批次的大小 batch_size = 100 # 计算一共有多少个批次 n_batc...原创 2018-02-27 16:55:06 · 219 阅读 · 0 评论 -
Tensorboard网络结构
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data # 载入数据集 mnist = input_data.read_data_sets("MNIST_data", one_hot=True) # 每个批次的大小 batch_size = 100 # 计算一共有多少个批次 n_batc...原创 2018-02-27 21:15:33 · 323 阅读 · 0 评论 -
TensorBoard网络运行
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data # 载入数据集 mnist = input_data.read_data_sets("MNIST_data", one_hot=True) # 每个批次的大小 batch_size = 100 # 计算一共有多少个批次 n_batc...原创 2018-02-28 15:45:44 · 218 阅读 · 0 评论 -
图的启动与创建
# 导入模块tensorflow import tensorflow as tf # 定义一个变量 形状为1行2列 m1 = tf.constant([[3, 3]]) # 定义一个变量 形状为2行1列 m2 = tf.constant([[2], [3]]) # 矩阵相乘 product = tf.matmul(m1, m2) # 定义一个会话 with tf.Session() as sess...原创 2018-02-26 16:02:42 · 168 阅读 · 0 评论