I’m new to Tensorflow I’m running a Deep learning Assignment from Udacity on iPython notebook. link And it has an error. Please help! How can I fix this? Thank you. Answer In older versions, it was called tf.initialize_all_variables.
Tag: tensorflow
How to generate random number in a given range as a Tensorflow variable
I am trying to use the normal distribution to calculate random numbers. but the numbers I get are floating points with many digits after the decimal, like this:0.14845988 Is there a way to make it generate numbers as int, and in a given range like [min, max] ? Answer Updated: Tensorflow >= r2.0 The documentation found at https://www.tensorflow.org/guide/random_numbers says that
Ordering of batch normalization and dropout?
The original question was in regard to TensorFlow implementations specifically. However, the answers are for implementations in general. This general answer is also the correct answer for TensorFlow. When using batch normalization and dropout in TensorFlow (specifically using the contrib.layers) do I need to be worried about the ordering? It seems possible that if I use dropout followed immediately by
In TensorFlow, how can I get nonzero values and their indices from a tensor with python?
I want to do something like this. Let’s say we have a tensor A. And I want to get nonzero values and their indices from it. There are similar operations in Numpy. np.flatnonzero(A) return indices that are non-zero in the flattened A. x.ravel()[np.flatnonzero(x)] extract elements according to non-zero indices. Here’s a link for these operations. How can I do somthing
tensorflow.train.import_meta_graph does not work?
I try to simply save and restore a graph, but the simplest example does not work as expected (this is done using version 0.9.0 or 0.10.0 on Linux 64 without CUDA using python 2.7 or 3.5.2) First I save the graph like this: This creates a file “file” that is non-empty and also sets g1 to something that looks like
How to find which version of TensorFlow is installed in my system?
I need to find which version of TensorFlow I have installed. I’m using Ubuntu 16.04 Long Term Support. Answer This depends on how you installed TensorFlow. I am going to use the same headings used by TensorFlow’s installation instructions to structure this answer. Pip installation Run: Note that python is symlinked to /usr/bin/python3 in some Linux distributions, so use python
What is the difference between ‘SAME’ and ‘VALID’ padding in tf.nn.max_pool of tensorflow?
What is the difference between ‘SAME’ and ‘VALID’ padding in tf.nn.max_pool of tensorflow? In my opinion, ‘VALID’ means there will be no zero padding outside the edges when we do max pool. According to A guide to convolution arithmetic for deep learning, it says that there will be no padding in pool operator, i.e. just use ‘VALID’ of tensorflow. But
tflearn / tensorflow does not learn xor
Following code was written to learn the XOR function, but about half of the time the network does not learn and the loss after each epoch stays the same. Sometimes I get correct results like this: But often this: My 2x2x1 network should be able to perform XOR, and there is even some evidence that suggests that this network should
What’s difference between tf.sub and just minus operation in tensorflow?
I am trying to use Tensorflow. Here is an very simple code. Just ignore the optimization part (4th line). It will take a floating number and train W1 so as to increase squared difference. My question is simple. If I use just minus sign instead of tf.sub” as below, what is different? Will it cause a wrong result? When I
What are logits? What is the difference between softmax and softmax_cross_entropy_with_logits?
In the tensorflow API docs they use a keyword called logits. What is it? A lot of methods are written like: If logits is just a generic Tensor input, why is it named logits? Secondly, what is the difference between the following two methods? I know what tf.nn.softmax does, but not the other. An example would be really helpful. Answer