tensorflow
-
windows tensorflow无法下载Fashion-mnist的解决办法
使用下面的语句下载数据集会报错连接超时等 import tensorflow as tf from tensorflow import keras fashion_mnist = keras.datasets.fashion_mnist (train_images, train_labels), (test_images, test_labels) = fa…
-
windows安装tensorflow gpu版本
tensorflow1.14.0和cuda10.0.0兼容性比较好,建议安装这两个版本 1、下载CUDA链接:https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64&target_version=10&target_type=ex…
-
依赖Anaconda环境安装TensorFlow库,避免采坑
TensorFlow™ 简介: TensorFlow是一个采用数据流图(data flow graphs),用于数值计算的开源软件库。节点(Nodes)在图中表示数学操作,图中的线(edges)则表示在节点间相互联系的多维数据数组,即张量(tensor)。它灵活的架构让你可以在多种平台上展开计算,例如台式计算机中的一个或多个CPU(或GPU),服务…
-
TensorFlow1.0 线性回归
import tensorflow as tf import numpy as np #create data x_data = np.random.rand(100).astype(np.float32) y_data = x_data*0.1+0.3 Weights = tf.Variable(tf.random_uniform([1],-1.0,1.0…
-
tensorflow1.0 队列FIFOQueue管理实现异步读取训练
import tensorflow as tf #模拟异步子线程 存入样本, 主线程 读取样本 # 1. 定义一个队列,1000 Q = tf.FIFOQueue(1000,tf.float32) #2.定义要做的事情 循环 值,+1 放入队列当中 var = tf.Variable(0.0) #实现一个自增 tf.assign_add data = tf.…
-
tensorflow1.0 构建神经网络做图片分类
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets(“MNIST_data”,one_hot=True) def add_layer(inputs,in_size,out_siz…
-
tensorflow1.0 dropout层
“”” Please note, this code is only for python 3+. If you are using python 2+, please modify the code accordingly. “”” import tensorflow as tf from sklearn.datasets import load_digi…
-
tensorflow1.0 构建lstm做图片分类
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data #this is data mnist = input_data.read_data_sets(“MNIST_data”,one_hot=True) lr = 0.001 train_iters…
-
tensorflow1.0 模型的保存与加载
import tensorflow as tf import numpy as np # ##Save to file # W = tf.Variable([[4,5,6],[7,8,9]],dtype=tf.float32,name=”weight”) # b = tf.Variable([[2,5,8]],dtype=tf.float32,name=”b…
-
tensorflow1.0 lstm学习曲线
import tensorflow as tf import numpy as np import matplotlib.pyplot as plt BATCH_START = 0 TIME_STEPS = 20 BATCH_SIZE = 20 INPUT_SIZE = 1 OUTPUT_SIZE = 1 CELL_SIZE = 10 LR = 0.0025…