Running our Network - Deep Learning with Neural Networks and TensorFlow

sentdex · 191K views · 2016 · 25:15

Open on YouTube

Machine learning & deep learningPython, Ruby & scripting languagestutorialdated

Why Stack Overflow recommends it

Stack Overflow users cite it as the tutorial they copied their MNIST and TensorFlow training code from when they ask about errors in that code.

Recommended by 1 people across 1 different months, 2016 to 2020.

What it is

Part four of sentdex's Deep Learning with Neural Networks and TensorFlow series, part of his wider Python machine learning tutorials. He writes the code for what runs inside the TensorFlow Session, setting up the training loop for a feedforward network on MNIST.

What people said

Recommends zerogravty · 2016-12 · Stack Overflow · on “MNIST classification in tensorflow, RecursionError: maximum recursion depth exceeded”

I ran a Neural Network model for MNIST classification and received error- RecursionError: maximum recursion depth exceeded I checked some of the issues on stackoverflow and tried to increase the recursion limit to 1500 but did not work. How should I increase the limit? An how do I know what limit will cause stack overflow? I followed the tutorial from here [this video] I have Anaconda 3.5 distribution on my windows 10 machine. The full code is here- import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist= input_data.read_data_sets("/tmp/data/", one_hot=True) n_nodes_hl1 = 500 n_nodes_hl2 = 500 n_nodes_hl3 =500 n_classes = 10 batch_size = 100 #height x weight x = t

Cites Clement · 2016-08 · Stack Overflow · on “Tensorflow error: Invalid argument: shape must be a vector”

I was trying out tensorflow with the Titanic data from Kaggle: [LINK] Here's the code I tried to implement from Sendex: [this video] import tensorflow as tf import cleanData import numpy as np train, test = cleanData.read_and_clean() train = train[['Pclass', 'Sex', 'Age', 'Fare', 'Child', 'Fam_size', 'Title', 'Mother', 'Survived']] # one hot train['Died'] = int('0') train["Died"][train["Survived"] == 0] = 1 print(train.head()) n_nodes_hl1 = 500 n_classes = 2 batch_size = 100 # tf graph input x = tf.placeholder("float", [None, 8]) y = tf.placeholder("float") def neural_network_model(data): hidden_layer_1 = {'weights':tf.Variable(tf.random_normal([8, n_nodes_hl1])), 'biases':tf.Variable(tf.random_n

Cites HS1300 · 2017-05 · Stack Overflow · on “Tensorflow shape not correct”

I've been trying to use Tensorflow, but I keep getting errors regarding the shape of my data. I'm getting my code from this YouTube tutorial: [this video] My training data is this: enc0 = np.array([[[1,2,3,4],[0,1,0,1],[-33,0,0,0],[1,1,1,1]],[[2,3,3,2],[0,0,0,0],[9,0,0,0],[0,0,0,1]]]) # shape (2,4,4) ms0 = np.array([[1,6],[2,7]]) # shape (2,2) My error is this: ValueError: Dimension size must be evenly divisible by 10 but is 4 for 'gradients/Reshape_grad/Reshape' (op: 'Reshape') with input shapes: [1,4], [2]. I believe my error is occurring because of these lines: x = tf.placeholder('float',[None,16]) y = tf.placeholder('float',[4]) enc = enc0.reshape([-1,16]) My entire code is this: enc0 = np.ar

Cites Markus · 2017-09 · Stack Overflow · on “Getting an Error in TensorFlow”

I am following along on a TensorFlow tutorial on youtube and I have ran into an error: This is my code: import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("/tmp/data/",one_hot=True) n_nodes_hl1 = 500 n_nodes_hl2 = 500 n_nodes_hl3 = 500 n_classes = 10 batch_size = 100 # height x width x = tf.placeholder("float") y = tf.placeholder("float") def neural_network_model(data): hidden_1_layer = {"weights":tf.Variable(tf.random_normal([784,n_nodes_hl1])),"biases":tf.Variable(tf.random_normal([n_nodes_hl1]))} hidden_2_layer = {"weights":tf.Variable(tf.random_normal([n_nodes_hl1,n_nodes_hl2])),"biases":tf.Variable(tf.random_normal([n_nod

Cites lel lala · 2020-11 · Stack Overflow · on “How can I use version 2.0 of Tensorflow in python 3.7.9 and use the displacement function?”

I was following a tutorial by this guy: [this video] , and now I have run into a Error. The programm tells me : "AttributeError: module 'tensorflow' has no attribute 'placeholder'". I know that in version 2.0 and higher (of tensorflow) the placeholder function got removed, however I am unable to figure out another way of making my script work as I am just starting out with Deep Learning! Help would be greatly appreciated! Here is my code (I am using PyCharm as an IDE, dont know if thats a source for the Error): import tensorflow as tf mnist = tf.keras.datasets.mnist #Hidden Layers n_nodes_hl1 = 500 # Can be different from others (they do no HAVE to be the same number) n_nodes_hl2 = 500 n_nodes_hl