Category: Theano

  • What is the image_data_format parameter in Keras, and why is it important

    We’ve talked about the image_dim_ordering parameter in Keras and why is it important. But since from Keras v2 changed the name of the parameter, I thought of bringing this up again. As you know, Keras  is a higher-level neural networks library for Python, which is capable of running on top of TensorFlow, CNTK (Microsoft Cognitive…

  • Using Bottleneck Features for Multi-Class Classification in Keras and TensorFlow

    Training an Image Classification model – even with Deep Learning – is not an easy task. In order to get sufficient accuracy, without overfitting requires a lot of training data. If you try to train a deep learning model from scratch, and hope build a classification system with similar level of capability of an ImageNet-level…

  • image_data_format vs. image_dim_ordering in Keras v2

    If you have been using Keras for some time, then you would probably know the image_dim_ordering parameter of Keras. Specially, if you switch between TensorFlow and Theano backends frequently when using Keras. When I first started using Keras for image classification, most of my experiments failed because I have set the image_dim_ordering incorrectly. Learning from…

  • How to solve CNMEM_STATUS_OUT_OF_MEMORY error with Theano on CUDA

    Have yo come across the CNMEM_STATUS_OUT_OF_MEMORY error when using Theano with CUDA, with Keras? You might have been trying to train a slightly larger model, and just when the training starts it throws this error and fails. The CNMEM_STATUS_OUT_OF_MEMORY thrown in Theano with CUDA The full error stack looks something like this, Traceback (most recent call…

  • Setting up Keras and Anaconda Python on Ubuntu 16.10

    I’ve been using Anaconda Python for most of my Machine Learning experiments, mainly because of the flexibility it gives with the isolated Python environments. I recently did a post on how to install Keras on Anaconda on Windows. I’m planning to switch to Linux for few of my experiments, so I decided to try out…

  • Can the LeNet model handle Face Recognition?

    I recently followed a blog post – at PyImageSearch by Adrian Rosebrock – on using the LeNet Convolutional Neural Network model on the MNIST dataset – i.e. use for handwritten digit recognition – using Keras with Theano backend. I was able to easily try it out thanks to the very detailed and well thought out…

  • What is the image_dim_ordering parameter in Keras, and why is it important

    Update 9/May/2017: With Keras v2, the image_dim_ordering parameter has been renamed to image_data_format. Check my updated post on how to configure it. If you remember my earlier post about switching Keras between TensorFlow and Theano backends, you would have seen that we switched the image_dim_ordering parameter also when switching the backend. For TensorFlow, image_dim_ordering should…

  • Switching between TensorFlow and Theano on Keras

    Keras speeds up the task of building Neural Networks by providing high-level simplified functions to create and manipulate neural models. It itself does not provide the lower level neural and deep learning functions, but it’s rather meant to be run on an engine – which Keras refers to as a “backend” – which would provide…

  • Working Theano configs

    Here are the Theano configurations that I have tested and worked. These were tested on Windows 10 64-Bit, and Windows 7 64-Bit. (I will update when I test on other OS’s and setups) With GPU support, on CUDA and cuDNN In order to allow Theano to use the GPU, you need to be on a…