- Check Spot Instance Pricing here
- Open EC2 console
- Choose AMI :
Deep Learning AMI (Ubuntu) Version 8.0 - ami-dff741a0
- contains TensorFlow and other famous DL libraries
- make sure you select the "Ubuntu" version and not "Amazon Linux" version
- Instance Type : Select an instanct type from the p2/p3 family
- For inference purposes - p2.xlarge (1 x Nvidia Tesla K80)
- For training purposes - p3.xlarge (1 x Nvidia Tesla V100)
- Configure Instance :
- Check
Request Spot instances
- Check
- Add Storage :
- For inference purposes - Select 150GB (Magnetic) -- keeps cost low
- For training purposes - Select 500GB+ (SSD) -- keeps read times low
- You may check / uncheck - "Delete on Termination"
- Add Tags :
- Always add tags as its helps while using the Bill Explorer
- Simple option is
{'project' : <project-name>}
- Configure Security Group :
- Open ports for
- 22 : SSH
- 5000 : Flask Server
- 6060 : Tensorboard
- 8888 : Jupyter Notebook
- Open ports for
- Review :
- Do take 2-3 mins to go through this.
- Key-Pair :
- Either create a new .pem file or use an existing .pem file
- Go to your EC2 Dashboard
- Copy the IPV4 Public IP
- Open a Command Prompt
- ssh -i .pem ubuntu@
- Setup Tensorflow
for TensorFlow(+Keras2) with Python3 (CUDA 9/MKL) ____________ source activate tensorflow_p36
- First activation might takes some time (3+ mins)
- Make a note of the library versions (for future references) in a .txt file
- Once installation is done, the command line shall be prepended by the environment name
(tensorflow_p36)
- Some Basic Checks
- Check Nvidia Driver Version -
nvidia-smi
- Check GPU - CUDA :
cd /usr/local/cuda-9.0/samples/1_Utilities/deviceQuery
sudo make -j4 deviceQuery
pyth
-->Detected 1 CUDA Capable device(s)
- Check default Python version
- Type
python
--> Check top lines of the interpreter tht opens up
- Type
- Check pip version
pip --version
- Check Nvidia Driver Version -
- Install all the requisite libraries for your application
- Imaging Libs
- pip install opencv-python Pillow scikit-image
- pip install shapely descartes matplotlib
- Python - Web Server Libs
- pip install flask
- Storage Libs
- pip install h5py
- Ubuntu Libs
- sudo apt install ncdu htop
- Other DL Libs
- sudo pip -Iv install dlib (if inside a virtualenv - AWS Deep Learning AMI)
- Time Consuming (5mins + )
- sudo pip -Iv install dlib (if inside a virtualenv - AWS Deep Learning AMI)
- Check the used up size
df -h
(Look for/dev/xvda1
) --> (usually Used = 47G)
- Check if all the above libraries are callable in a python interpreter
- Imaging Libs