Run Github Projects on GPU in a cheap way
There are many great Github projects that you can use to learn machine learning. In fact, it is an effective way to learn machine learning quickly. However, when the Github projects require high computing power, there is one issue that you need to solve, that is, where you can find a cheap GPU machine meeting the computation power requirements.
I came across a service named vast.ai. Vast.ai is a site like Airbnb, where people share their GPU computation resources instead of real estate property. Because of its nature of GPU-sharing, the price is really cheap.
I am going to give an introduction of how to start to use vast.ai to run a Github project for learning purposes.
First, sign up for vast.ai.
Second, rent a GPU machine. From the left-hand navigation menu, you will see the submenu as below:
Select ‘create’ to rent a GPU machine.
You have all kinds of options. Pick one meeting your needs. You can select what docker images to preinstall for instance configurations, like TensorFlow, PyTorch, etc..
Third, start the instance and then click the ‘connect’ button to go to the Jupyter Notebook interface. You may need to wait for about a half minute before the Jupyter Notebook gets ready to use.
Fourth, install Git and Pip in the terminal. Just as you create a new Python file, you select ‘Terminal’ to open a terminal window as below:
run the following scripts to install Git and Pip so that you can clone the Github projects and install required packages:
apt-get update
apt-get install git
apt-get install python3-pip
Fifth, clone the Github project to the rented GPU instance. Below is the code to clone pyAudioAnalysis Github project to the instance:
git clone https://github.com/tyiannak/pyAudioAnalysis.git
Once it’s done, you can go to the cloned project folder to start testing the project codes.
There are some other free resources like google Colab, binder, etc.. I still enjoy these free resources. However, I have more freedom of choosing any computing power and configurations as I need when I use the service of vast.ai. Hope you like it as well.