Skip to content

Commit

Permalink
Add: server name variable
Browse files Browse the repository at this point in the history
  • Loading branch information
zaiyou12 committed Oct 21, 2018
1 parent 70963e9 commit 5280064
Showing 1 changed file with 43 additions and 21 deletions.
64 changes: 43 additions & 21 deletions setting.sh
Original file line number Diff line number Diff line change
@@ -1,42 +1,64 @@
# 1. Initial Setting & Jupyter notebook
## Access to server
ssh -L 8888:localhost:8888 p3-tokyo-ml
# 0. Initialize
## Prepare two tabs, one for train, one for transfer data and tensorboard
## AMI: Ubuntu deeplearning ami
## Storage: 100gib


# 1. Initial Setting for both tabs
export SERVER_NAME=virginia-dl
export SERVER_NAME=ohio-dl
export SERVER_NAME=oregon-dl
export SERVER_NAME=canada-dl
export SERVER_NAME=london-dl
export SERVER_NAME=frankfurt-dl

## Access to server in first tab
ssh ${SERVER_NAME}

## Deeplearning EC2 Setup
sudo locale-gen ko_KR.UTF-8
sudo apt-get install tmux unzip

## Fetch Dishi detection and mask rcnn file
git clone https://github.com/zaiyou12/Gatten_sushi_dishi_detection.git

## Run jupyter notebook
cd Gatten_sushi_dishi_detection
source activate tensorflow_p36
pip install --upgrade pip
## jupyter notebook

# 2. Setting for Trainning model

# 2. Send Data to server in second tab
## local to remote
export SERVER_NAME=oregon-dl
scp data.zip mask_rcnn_coco.h5 ${SERVER_NAME}:/home/ubuntu/Gatten_sushi_dishi_detection/
cd Gatten_sushi_dishi_detection
cd ~/Desktop/gatten/
scp -r dish_server/* ${SERVER_NAME}:/home/ubuntu


# 3. Unzip data in first tab
unzip *.zip
rm -rf data.zip
exit


## Start Trainning
# 4. Reconnect EC2 for trainning in first tab
ssh ${SERVER_NAME}

## change data if needed
## vim dish.py
tmux new -s train

source activate tensorflow_p36
pip install imgaug opencv-python
python3 dish.py train --dataset=${PWD}/data --weights=coco --pairs BACKBONE=resnet50
python3 dish.py train --dataset=${PWD}/data --weights=last;mail -s 'Finished' zaiyou12@gmail.com; sudo shutdown now;
python3 dish.py train --dataset=${PWD}/data --weights=coco --pairs BACKBONE=resnet101


# 5. Run TensorBoard in second tab
ssh -L 6006:localhost:6006 ${SERVER_NAME}

# 3. Run TensorBoard
ssh -L 6006:localhost:6006 p3-tokyo-ml
cd Gatten_sushi_dishi_detection
source activate tensorflow_p36
tensorboard --logdir=${PWD}/logs


# 9. Run in tensorflow docker
nvidia-docker run -d -p 8888:8888 -p 6006:6006 -e PASSWORD=1111 -v ${PWD}:/notebooks/works tensorflow/tensorflow:latest-gpu-py3
cd ~/Desktop/gatten/Gatten_sushi_dishi_detection
nvidia-docker run -d -p 8888:8888 -p 6006:6006 -e PASSWORD=1111 --name board -v ${PWD}:/notebooks/works tensorflow/tensorflow:latest-gpu-py3
nvidia-docker exec -it board bash

cd works
pip install scikit-image==0.13.1 imgaug opencv-python
apt-get install -y libsm6 libxext6 libxrender-dev
tensorboard --logdir=${PWD}/models

0 comments on commit 5280064

Please sign in to comment.