Category: Python

  • Fixing the KeyError: ‘acc’ and KeyError: ‘val_acc’ Errors in Keras 2.3.x

    Fixing the KeyError: ‘acc’ and KeyError: ‘val_acc’ Errors in Keras 2.3.x

    Have you been using the ‘History’ object returned by the fit() functions of Keras to graph or visualize the training history of your models? And have you been getting a ‘KeyError’ type error such as the following since recent Keras upgrade and wondering why? Traceback (most recent call last): File “lenet_mnist_keras.py”, line 163, in <module>…

  • Cleaning up your Anaconda installations

    If you’ve been using Anaconda Python for a while, and been creating multiple environments and adding/removing packages, you may have noticed that it’s starting to take up a lot of disk space (sometimes tens of GBs). Anaconda installation can get big One reason is that anaconda environments are completely isolated workspaces from each other with…

  • Fixing the Matplotlib PyPlot import errors

    About a week back, I was reinstalling Keras, TensorFlow and all the other libraries after a reformat of my PC. When I started verifying the library installations, I came across a strange error. When I tried to run a simple deep learning model, Python runtime crashed. As soon as I execute the script I was…

  • Need More Fonts on OpenCV?

    OpenCV has a built-in simple function to add text on your images – the cv2.putText() function. With just one line of code, you can add text anywhere on the image. You just need to specify the position, colour, scale (font size), and which the font to use as the minimum parameters. cv2.putText(image, text_to_show, (20, 40), fontFace=cv2.FONT_HERSHEY_SIMPLEX,…

  • Snapchat like Image Overlays with Dlib, OpenCV, and Python

    You’re probably familiar with Snapchat, and it’s filters feature where you can put some cool and funny image overlays on your face images. As computer vision enthusiasts, we typically look at applications like these, and try to understand how it’s done, and whether we can build something similar. It turns out, we can make our…

  • Machine UI : An IDE for Machine Learning, currently in Alpha

    Machine UI, or just “Machine” as it’s commonly referred, is an IDE for Machine Learning, which is currently in its Alpha stage. It has been designed to work with TensorFlow, and aims at simplifying setting up machine Learning experiments so that you spend more time experimenting, and less time configuring. The interface of Machine UI…

  • Easy Speech Recognition in Python with PyAudio and Pocketsphinx

    If you remember, I was getting started with Audio Processing in Python (thinking of implementing an audio classification system) a couple of weeks back (see my earlier post). I got the PyAudio package setup and was having some success with it. As you know, one of the more interesting areas in audio processing in machine…

  • Setting up TensorFlow with CUDA on Windows

    I did the post about How to setup TensorFlow on Windows about a month back. I only covered setting up the CPU version of TensorFlow there, and promised that I’ll do the guide for the GPU version soon. But I haven’t had the change to come round to write the guide until now. I guess…

  • Installing OpenCV 3 on Anaconda Python 3.5 on Windows

    If you checked my last post, you know that TensorFlow now officially works on Windows. This was really exciting to me, since I was using a Linux machine for my TensorFlow experiments, I had to switch between the Linux and Windows for my other tasks. Now, I should be able to perform some of those…