I’m a bit confused about the number of layers that are used in Keras models. The documentation is rather opaque on the matter. According to Jason Brownlee the first layer technically consists of two layers, the input layer, specified by input_dim and a hidden layer. See the first questions on his blog. In all of the Keras documentation the first
Tag: tensorflow
How to disable printing reports after each epoch in Keras?
After each epoch I have printout like below: I am not using built-in epochs, so I would like to disable these printouts and print something myself. How to do that? I am using tensorflow backend if it matters. Answer Set verbose=0 to the fit method of your model.
Tensorflow on windows – ImportError: DLL load failed: The specified module could not be found
I’m using Anaconda 3.1.0 on Windows 7 64 bit. I have installed tensorflow(GPU). I am getting errors while running following command. >>> import tensorflow as tf The complete traceback Answer cudnn lib version was wrong, so I replaced correct version of cudnn lib and it worked.
Tensorflow Executor failed to create kernel. Unimplemented: Cast string to float is not supported
I’m trying to build a custom CNN classifier for a load of cancer images (.png) using Tensorflow 1.1.0 and TFLearn 0.3.1 by largely following someone else’s CNN classifier here, however when I try to fit my model Tensorflow is throwing out the following errors: I am using tflearn.data_utils.image_preloader to read the png files in however I have also tried using
Reconstructing an image after using extract_image_patches
I have an autoencoder that takes an image as an input and produces a new image as an output. The input image (1x1024x1024x3) is split into patches (1024x32x32x3) before being fed to the network. Once I have the output, also a batch of patches size 1024x32x32x3, I want to be able to reconstruct a 1024x1024x3 image. I thought I had
How do you compute accuracy in a regression model, after rounding predictions to classes, in keras?
How would you create and display an accuracy metric in keras for a regression problem, for example after you round the predictions to the nearest integer class? While accuracy is not itself effectively defined conventionally for a regression problem, to determine ordinal classes/labels for data, it is suitable to treat the problem as a regression. But then it would be
TensorFlow FileWriter not writing to file
I am training a simple TensorFlow model. The training aspect works fine, but no logs are being written to /tmp/tensorflow_logs and I’m not sure why. Could anyone provide some insight? Thank you Answer A combination of changing the file path from /temp/… to temp/… and adding summary_writer.flush() and summary_writer.close() made the logs be written successfully.
What do the functions tf.squeeze and tf.nn.rnn do?
What do the functions tf.squeeze and tf.nn.rnn do? I searched these API, but I can’t find argument, examples etc. Also, what is the shape of p_inputs formed by the following code using tf.squeeze, and what is the meaning and case of using tf.nn.rnn? Answer The best source of answers to questions like these is the TensorFlow API documentation. The two
How do you read Tensorboard files programmatically?
How can you write a python script to read Tensorboard log files, extracting the loss and accuracy and other numerical data, without launching the GUI tensorboard –logdir=…? Answer You can use TensorBoard’s Python classes or script to extract the data: How can I export data from TensorBoard? If you’d like to export data to visualize elsewhere (e.g. iPython Notebook), that’s
Export weights of neural network using tensorflow
I wrote neural-network using tensorflow tools. everything working and now I want to export the final weights of my neural network to make a single prediction method. How can I do this? Answer You will need to save your model at the end of training by using the tf.train.Saver class. While initializing the Saver object, you will need to pass