- 博客(19)
- 收藏
- 关注
原创 显示数据集
from keras.datasets import cifar10(x_train,y_train),(x_test,y_test)=cifar10.load_data();import matplotlib.pyplot as pltdef plot_images_labels_prediction(images,labels,idx,num=10): fig=plt.gcf...
2018-10-09 14:08:45 244
翻译 keras实战cifar10数据集
from keras.datasets import cifar10import numpy as npnp.random.seed(10);(x_Train,y_Train),(x_Test,y_Test)=cifar10.load_data();print("train data:","images:",x_Train.shape,"labels:",y_Train.shape);...
2018-10-09 09:19:35 955 1
翻译 TensorFlow断点处理
//saverimport tensorflow as tfv1=tf.Variable(tf.constant(1.0,shape=[1]),name='v1');v2=tf.Variable(tf.constant(2.0,shape=[1]),name='v2');result=v1+v2;init_op=tf.initialize_all_variables();saver...
2018-10-08 09:09:04 532
翻译 linux下安装anaconda并启动Jupyter Notebook
wget anaconda*.shbash anaconda*.sh -bsudo gedit ~/.bashrcexport PATH="/home/user/anaconda3/bin:$PATH"
2018-10-08 09:08:57 14366
翻译 导出pb模型和导入pb模型
**//导出pb模型**import tensorflow as tffrom tensorflow.python.framework import graph_utilv1=tf.Variable(tf.constant(1.0,shape=[1]),name='v1');v2=tf.Variable(tf.constant(2.0,shape=[1]),name='v2');res...
2018-10-08 09:08:47 2763
翻译 windows下在anaconda下建立虚拟python环境
md \pythonwork && cd \pythonworkconda create --name tensorFlow python=3.5 anacondaactivate tensorFlowdeactivate tensorFlow
2018-10-08 09:08:38 868
翻译 Keras多层感知器识别手写数字
from keras.utils import np_utilsimport numpy as npnp.random.seed(10);from keras.datasets import mnist(x_train_image,y_train_label),(x_test_image,y_test_label)=mnist.load_data();# 特征值进行reshapex...
2018-10-08 09:08:21 265
翻译 keras卷积神经网络识别手写体
from keras.datasets import mnistfrom keras.utils import np_utilsimport numpy as npnp.random.seed(10);(x_Train,y_Train),(x_Test,y_Test)=mnist.load_data();print("done");x_Train4D=x_Train.reshape(...
2018-10-08 09:08:09 340
翻译 生成pb文件
from PIL import Imageimport numpy as npimport matplotlib.pyplot as pltimport matplotlib.image as mpimgimport tensorflow as tfimport osimport globfrom skimage import io, transformfrom tensorflo...
2018-10-07 10:25:15 854
翻译 完整自编码器
import tensorflow as tfimport tensorflow.contrib.slim as slimfrom tensorflow.examples.tutorials.mnist import input_dataimport numpy as npimport matplotlib.pyplot as pltmnist=input_data.read_data...
2018-10-07 10:23:37 138
翻译 Mnistinfogan
import numpy as npimport tensorflow as tfimport matplotlib.pyplot as pltfrom scipy.stats import normimport tensorflow.contrib.slim as slimfrom tensorflow.examples.tutorials.mnist import input_da...
2018-10-07 10:21:41 491
翻译 下载Inception
import tensorflow as tfimport requestsimport osimport tarfileinception_url="http://download.tensorflow.org/models/image/imagenet/inception-2015-12-05.tgz";inception_url_dir="model/";if not os.p...
2018-10-07 10:16:36 544
翻译 利用tensorflow对jpeg格式图像编码解码操作
import tensorflow as tfimport matplotlib.pyplot as pltimport globfrom skimage import ioimage_raw_data=tf.gfile.FastGFile('flower/daisy/5547758_eea9edfd54_n.jpg','rb').read();with tf.Session() as...
2018-10-07 10:15:08 1518
翻译 tensorflow实现迁徙学习
import globimport os.pathimport randomimport tensorflow as tffrom tensorflow.python.platform import gfile#Inception-V3模型瓶颈层的节点个数BOTTLENECK_TENSOR_SIZE=2048;#Inception模型中代表瓶颈层结果的张量的名称,在谷歌提供的模型中...
2018-10-07 10:13:27 191
翻译 tensorflow处理图像函数
import matplotlib.pyplot as plt;import tensorflow as tf;img_raw = tf.gfile.FastGFile('path/output.jpg', 'rb').read()img = tf.image.decode_jpeg(img_raw)img = tf.image.convert_image_dtype(img, dtyp...
2018-10-07 10:12:16 177
翻译 MNIST无监督学习-自编码器
import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_dataimport numpy as npimport matplotlib.pyplot as pltmnist=input_data.read_data_sets("mnist",one_hot=True);#设置超参数lea...
2018-10-07 10:10:34 692 1
翻译 将数据集转化为tfrecord并读取tfrecord
**//将数据集转化为tfrecord** import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data import numpy as np def _int64_feature(value): ...
2018-10-07 10:06:21 2090
翻译 读取图片生成标签
import osfrom skimage import io,transformimport globimport numpy as nppath="flower/";h=224;w=224;c=3;pathname=[path+x for x in os.listdir(path)];print(pathname);count=0;imgs=[];labels=[]...
2018-10-07 09:59:20 535
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人