Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tlatkowski/u-net-tpu
Tensorflow implementation of U-Net model with TPU Estimator support.
https://github.com/tlatkowski/u-net-tpu
cnn convolutional-neural-networks deep-learning distributed-training encoder-decoder google-cloud-platform image-classification image-processing image-recognition image-segmentation tensorflow tensorflow-models tpu u-net unet unet-image-segmentation unet-model unet-tensorflow vision
Last synced: about 1 month ago
JSON representation
Tensorflow implementation of U-Net model with TPU Estimator support.
- Host: GitHub
- URL: https://github.com/tlatkowski/u-net-tpu
- Owner: tlatkowski
- License: apache-2.0
- Created: 2018-09-30T10:34:42.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-20T09:17:59.000Z (about 6 years ago)
- Last Synced: 2024-10-30T08:19:20.780Z (3 months ago)
- Topics: cnn, convolutional-neural-networks, deep-learning, distributed-training, encoder-decoder, google-cloud-platform, image-classification, image-processing, image-recognition, image-segmentation, tensorflow, tensorflow-models, tpu, u-net, unet, unet-image-segmentation, unet-model, unet-tensorflow, vision
- Language: Python
- Homepage:
- Size: 159 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
**[Under development]**
# TPU-optimized U-Net model implementation
### Model description
This repository contains U-Net model implementation (originally proposed in [U-Net: Convolutional Networks for Biomedical Image Segmentation](https://arxiv.org/abs/1505.04597))
with usage of Tensoflow TPUEstimators API.##### Model architecture
### Training U-Net on Cloud TPU
##### Config your TPU flock:
Check your current Cloud TPU configuration (in Google Cloud Shell):
```bash
ctpu print-config
```As a result you should get the similar outcome
```bash
ctpu configuration:
name: your-user-name
project: your-project-name
zone: your-zone
```To run CTPU flock, in Google Cloud Shell, execute the following command
```bash
ZONE=YOUR-ZONE
TPU_NAME=YOUR-TPU-NAMEctpu up --zone $ZONE --name $TPU_NAME
```Once the CTPU flock is ready, ssh to your instance
```bash
GCP_PROJECT=YOUR-GCP-PROJECTgcloud compute --project $GCP_PROJECT ssh --zone $ZONE $TPU_NAME
```##### Create bucket for storing training checkpoints:
Execute the following commands to create a bucket on your TPU VM instance:
```bash
GCP_PROJECT=YOUR-GCP-PROJECT
MODEL_DIR=gs://YOUR-GOOGLE-CLOUD-BUCKETgsutil mb -p $GCP_PROJECT $MODEL_DIR
```##### Training U-Net model as a classifier on Cloud TPU
In order to train your MNIST image classifier based on U-Net architecture and with the usage of Cloud TPU
use **u_net_clf_tpu.py** script with the following parameters:
```bash
# TPU configuration
GCP_PROJECT=YOUR-GCP-PROJECT
TPU_ZONE=YOUR-TPU-ZONE
TPU_NAME=YOUR-TPU-NAME
MODEL_DIR=gs://YOUR-GOOGLE-CLOUD-BUCKET# problem/model configuration
PROBLEM=MNIST
TRAIN_DIR=PATH-TO-TRAIN-DIR
EVAL_DIR=PATH-TO-EVALUATION-DIRpython u_net_clf_tpu.py \
--train_dir=$TRAIN_DIR \
--eval_dir=$EVAL_DIR \
--problem=$PROBLEM \
--model_dir=$MODEL_DIR \
--tpu_name=$TPU_NAME \
--tpu_zone=$TPU_ZONE \
--gcp_project=$GCP_PROJECT
```##### Vizualize model training on Tensorboard
```bash
gcloud auth application-default login
``````bash
tensorboard --logdir $MODEL_DIR
```