Closed graydove closed 6 years ago
Thank you for your post. We noticed you have not filled out the following field in the issue template. Could you update them if they are relevant in your case, or leave them as N/A? Thanks. Have I written custom code OS Platform and Distribution TensorFlow installed from TensorFlow version Bazel version CUDA/cuDNN version GPU model and memory Exact command to reproduce
It has been 14 days with no activity and the awaiting response
label was assigned. Is this still an issue? Please update the label and/or status accordingly.
It has been 14 days with no activity and the awaiting response
label was assigned. Is this still an issue? Please update the label and/or status accordingly.
Nagging Awaiting Response: It has been 14 days with no activityand the awaiting response
label was assigned. Is this still an issue?
Nagging Awaiting Response: It has been 14 days with no activityand the awaiting response
label was assigned. Is this still an issue?
Nagging Awaiting Response: It has been 14 days with no activityand the awaiting response
label was assigned. Is this still an issue?
Nagging Awaiting Response: It has been 14 days with no activityand the awaiting response
label was assigned. Is this still an issue?
It has been 14 days with no activity and the awaiting response
label was assigned. Is this still an issue?
Automatically closing due to lack of recent activity. Please update the issue when new information becomes available, and we will reopen the issue. Thanks!
coding=utf-8
tensorflow 1.4
python 3.6
import os import numpy as np import tensorflow as tf from PIL import Image
获取dataset
def load_data(dataset_path): img = Image.open(dataset_path)
定义一个20 × 20的训练样本,一共有40个人,每个人都10张样本照片
def convolutional_layer(data, kernel_size, bias_size, pooling_size): #数据,卷积核,偏差,池 kernel = tf.get_variable("conv", kernel_size, initializer=tf.random_normal_initializer()) bias = tf.get_variable('bias', bias_size, initializer=tf.random_normal_initializer()) conv = tf.nn.conv2d(data, kernel, strides=[1, 1, 1, 1], padding='SAME') #strides步长,padding卷积方式,表示卷积核可以停留在图像边缘 linear_output = tf.nn.relu(tf.add(conv, bias)) #激活函数
pooling: Tensor("conv_layer2/MaxPool:0", shape=(40, 15, 12, 64), dtype=float32)
def linear_layer(data, weights_size, biases_size): weights = tf.get_variable("weigths", weights_size, initializer=tf.random_normal_initializer()) #卷积权重矩阵 biases = tf.get_variable("biases", biases_size, initializer=tf.random_normal_initializer()) return tf.add(tf.matmul(data, weights), biases) #f(x) = Wx + b
def convolutional_neural_network(data):
根据类别个数定义最后输出层的神经元
def train_facedata(dataset, model_dir,model_path):
def main(): dataset_path = "olivettifaces.gif" data = load_data(dataset_path) model_dir = './model' model_path = model_dir + '/best.ckpt' print(len(data)) train_facedata(data, model_dir, model_path)
if name == "main" : main()
I am sure I have set the bias and the convince of the conv_layer3, but it calls me they are not exist.