Skip to main content

All Questions

Tagged with
666votes
28answers
494kviews

How to save/restore a model after training?

After you train a model in Tensorflow: How do you save the trained model? How do you later restore this saved model?
mathetes's user avatar
373votes
16answers
290kviews

How to prevent tensorflow from allocating the totality of a GPU memory?

I work in an environment in which computational resources are shared, i.e., we have a few server machines equipped with a few Nvidia Titan X GPUs each. For small to moderate size models, the 12 GB of ...
Fabien C.'s user avatar
780votes
11answers
698kviews

Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2

I have recently installed tensorflow (Windows CPU version) and received the following message: Successfully installed tensorflow-1.4.0 tensorflow-tensorboard-0.4.0rc2 Then when I tried to run import ...
csg's user avatar
  • 8,206
723votes
61answers
999kviews

TensorFlow not found using pip

I'm trying to install TensorFlow using pip: $ pip install tensorflow --user Collecting tensorflow Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching ...
user avatar
234votes
13answers
326kviews

Keras, How to get the output of each layer?

I have trained a binary classification model with CNN, and here is my code model = Sequential() model.add(Convolution2D(nb_filters, kernel_size[0], kernel_size[1], border_mode=...
GoingMyWay's user avatar
316votes
25answers
652kviews

How to print the value of a Tensor object in TensorFlow?

I have been using the introductory example of matrix multiplication in TensorFlow. matrix1 = tf.constant([[3., 3.]]) matrix2 = tf.constant([[2.],[2.]]) product = tf.matmul(matrix1, matrix2) When I ...
Dawny33's user avatar
  • 11.1k
346votes
13answers
1.0mviews

Convert a tensor to numpy array in Tensorflow?

How to convert a tensor into a numpy array when using Tensorflow with Python bindings?
mathetes's user avatar
360votes
21answers
350kviews

Disable Tensorflow debugging information

By debugging information I mean what TensorFlow shows in my terminal about loaded libraries and found devices etc. not Python errors. I tensorflow/stream_executor/dso_loader.cc:105] successfully ...
Ghilas BELHADJ's user avatar
486votes
9answers
263kviews

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: tf.nn.softmax(logits, name=None) If logits is just a generic Tensor input, why is it named ...
Shubhashis's user avatar
16votes
3answers
6kviews

Keras not training on entire dataset

So I've been following Google's official tensorflow guide and trying to build a simple neural network using Keras. But when it comes to training the model, it does not use the entire dataset (with ...
Sabyasachi Bhoi's user avatar
11votes
2answers
7kviews

Keras Dense layer's input is not flattened

This is my test code: from keras import layers input1 = layers.Input((2,3)) output = layers.Dense(4)(input1) print(output) The output is: <tf.Tensor 'dense_2/add:0' shape=(?, 2, 4) dtype=float32&...
yadong sun's user avatar
48votes
3answers
82kviews

Make a custom loss function in keras

Hi I have been trying to make a custom loss function in keras for dice_error_coefficient. It has its implementations in tensorboard and I tried using the same function in keras with tensorflow but it ...
Subham Mukherjee's user avatar
166votes
19answers
488kviews

Tensorflow - ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type float)

Continuation from previous question: Tensorflow - TypeError: 'int' object is not iterable My training data is a list of lists each comprised of 1000 floats. For example, x_train[0] = [0.0, 0.0,...
SuperHanz98's user avatar
454votes
32answers
901kviews

How to tell if tensorflow is using gpu acceleration from inside python shell?

I have installed tensorflow in my ubuntu 16.04 using the second answer here with ubuntu's builtin apt cuda installation. Now my question is how can I test if tensorflow is really using gpu? I have a ...
Tamim Addari's user avatar
243votes
16answers
455kviews

How to get current available GPUs in tensorflow?

I have a plan to use distributed TensorFlow, and I saw TensorFlow can use GPUs for training and testing. In a cluster environment, each machine could have 0 or 1 or more GPUs, and I want to run my ...
Sangwon Kim's user avatar

153050per page
close