Posts

Showing posts from 2020

Freezing models in Tensorflow

Image
Not my original post. However made some updates minor in the posts with latest version Freeze Tensorflow models and serve on web In this tutorial, we shall learn how to freeze a trained Tensorflow Model and serve it on a webserver. You can do this for any network you have trained but we shall use the trained model for dog/cat classification in this earlier tutorial  and serve it on a python Flask webserver.  So you trained a new model using Tensorflow and now you want to show it off to your friends and colleagues on a website for a hackathon or a new startup idea. Let’s see how to achieve that. 1. What is Freezing Tensorflow models? Neural networks are computationally very expensive. Let’s look at the architecture of alexnet which is relatively simple neural network:  Let’s calculate the number of variables required for prediction:           conv1 layer: ( 11*11)*3*96 (weights) + 96 (biases)            = 34944           conv2 layer: ( 5*5)*96*256

Steps to install SoX with mp3 support in macOS X

Ankits-MacBook-Pro:lame-3.99.5 ankitshah$ brew install lame ==> Downloading https://homebrew.bintray.com/bottles/lame-3.99.5.high_sierra.bottle.1.tar.gz ######################################################################## 100.0% ==> Pouring lame-3.99.5.high_sierra.bottle.1.tar.gz Error: The `brew link` step did not complete successfully The formula built, but is not symlinked into /usr/local Could not symlink bin/lame Target /usr/local/bin/lame already exists. You may want to remove it:   rm '/usr/local/bin/lame' To force the link and overwrite all conflicting files:   brew link --overwrite lame To list all files that would be deleted:   brew link --overwrite --dry-run lame Possible conflicting files are: /usr/local/bin/lame /usr/local/include/lame/lame.h /usr/local/share/doc/lame/html/about.html /usr/local/share/doc/lame/html/abr.html /usr/local/share/doc/lame/html/cbr.html /usr/local/share/doc/lame/html/contact.html /usr/local/share/doc/lame/html/contributors.html

Making Alt key work in ITerm on Mac

Image
  Making the Alt Key Work in iTerm2 iTerm2 is a replacement for the default Terminal application on MacOS. It has many more handy features than Terminal , is free to download and is also open source 🎉. However, on first install, you can’t use the Option or Alt key (this key: ⌥ ) as you would in other applications: you can’t skip or jump over words by pressing Alt and the left or right keys. Instead you see sequences like [D or [C : With a little config, you can change this behaviour, which I’ll explain below. Note: I refer to the “Alt” key throughout this post, which is the text written on my old 2013 MacBook Pro keyboard, but this is normally called the “Option” key in MacOS. Open the “Preferences” menu: either find it in the “iTerm2” dropdown menu along the top of the screen or press the Cmd and comma keys. ⌘ + , Choose the “Profiles” menu. Select the “Keys” tab. Within the “Key Mappings” pane, find the mapping for the Alt a

Delete every other line in VIM File

How to delete every other line in a vim file?  :g/^/+d This will essentially delete all even numbered lines. If you’d like to delete all odd numbered lines, delete the first line in the file (ggdd) and then run the same command as above.

Best Visual Studio Code Extensions for Development

Image
21 best VScode Python extensions We will like you to follow us on some of the cool VScode Python extensions that will make your working experience on Visual Studio Code great and nice as a python developer. Visual Studio Code  is common among  developers  today because of its excellent features. It is an open-source, extensible, lightweight editor that is available on all platforms. It is not a coincidence that python developments on VScode look great – these aforementioned cool components make  python projects  nice on the editor. Here is the list 21 best Vscode Python  extensions  for python development: 1. Python by Microsoft This extension is very compatible with the Python programming language. It works well for python version 3.6 Features: Listing Debugging IntelliSense Code navigation Code formatting and many more More Details 2. Python Docstring by Nils Werner This extension works by producing docstrings for python f