-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
43 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |