colaboratory = Jupyter + GPU
Following these steps, you are able to enjoy GPU service for FREE.
1. Register a google account
2. Login to Google Drive
3. New folder(take a name whether you like)
4. Right-click the folder-Open with-Connect more apps
5. find "Colaboratory" and connect
6. create ipynb under the new folder
7. Edit-Notebook settings
(This style really recalls jupyter, but jupyter don't have a GPU...)
8. select GPU
Tips: Remember these steps. Each time you establish a new py file, you need to set the GPU again.
9. Test GPU?
Further, I am curious about which type of GPU google offered.
Tesla K80 ON Amazon-$2800.
10. Now you can enjoy a $2800-GPU for FREE.
Tips: As you know, you need to pip/conda many computation packages.
11. Authorized to use these packages.
run these codes in colab:
!apt-get install -y -qq software-properties-common python-software-properties module-init-tools
!add-apt-repository -y ppa:alessandro-strada/ppa 2>&1 > /dev/null
!apt-get update -qq 2>&1 > /dev/null
!apt-get -y install -qq google-drive-ocamlfuse fuse
from google.colab import auth
auth.authenticate_user()
from oauth2client.client import GoogleCredentials
creds = GoogleCredentials.get_application_default()
import getpass
!google-drive-ocamlfuse -headless -id={creds.client_id} -secret={creds.client_secret} < /dev/null 2>&1 | grep URL
vcode = getpass.getpass()
!echo {vcode} | google-drive-ocamlfuse -headless -id={creds.client_id} -secret={creds.client_secret}
click the link and get the verification code.
Next part is my personal demands. If any question, you can turn help to StackOverflow-google-colaboratory
12. Install Xgboost to compete with kaggle players.
!pip install -q xgboost==0.4a30 (this is a lower edition)
!apt-get -qq install -y graphviz && pip install -q pydot
Xgboost works perfectly
13. Install pytorch package.(I think the kernel is tensorflow)
!pip install -q http://download.pytorch.org/whl/{accelerator}/torch-0.3.0.post4-{platform}-linux_x86_64.whl torchvision
Test the famous dataset-mnist.
I meet some File Path problem.In colab, we'd better use the GetFullPath like "drive/foldername/filename".
14. We easily get access to Stack Overflow to modify our codes.
15.Through these installs, apparently, the packages are stored in our google cloud. Files the same as packages are saved to the cloud. So we just need a computer to transfer these files to cloud and put down our codes on colab.Then, colab help to read the data and use 2800$-GPU to run our neural network program.
I am a newcomer to colab. Now pycharm seems out of date compared with colab. Especially, when we are not easy to get a GPU. And why not share this ide with our friends? There remain many great usages in this fantastic plug-in unit. If there are any errors, please correct me.