| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
We demonstrate how to easily run synchronous distributed TensorFlow training using TensorFlow Estimator of Project Orca in BigDL. This example classifies movie reviews as positive or negative using the text of the review. See here for the original single-node version of this example provided by Tensorflow.
We recommend you to use Anaconda to prepare the environments, especially if you want to run on a yarn cluster(yarn-client mode only).
conda create -n bigdl python=3.7 #bigdl is conda enviroment name, you can set another name you like. conda activate bigdl pip install tensorflow==1.15 pip install --pre --upgrade bigdl-orca
The IMDB dataset comes packaged with TensorFlow. It has already been preprocessed such that the reviews (sequences of words) have been converted to sequences of integers, where each integer represents a specific word in a dictionary.
You can run this example on local mode and yarn client mode.
python basic_text_classification.py --cluster_mode localpython basic_text_classification.py --cluster_mode yarnpython basic_text_classification.py --cluster_mode k8s --k8s_master "k8s://https://127.0.0.1:8443" --container_image "intelanalytics/bigdl-k8s:latest"In above commands
You can find the logs for training:
DistriOptimizer$:426 - [Epoch 10 5632/14848][Iteration 272][Wall Clock 16.805771461s] Trained 512 records in 0.034776978 seconds. Throughput is 14722.383 records/second. Loss is 0.38606125.
And after validation, test results will be seen like:
2020-12-25 15:52:43 INFO DistriOptimizer$:111 - [Epoch 10 14848/14848][Iteration 290][Wall Clock 17.47923692s] Validate model... 2020-12-25 15:52:44 INFO DistriOptimizer$:177 - [Epoch 10 14848/14848][Iteration 290][Wall Clock 17.47923692s] validate model throughput is 119.15809 records/second 2020-12-25 15:52:44 INFO DistriOptimizer$:180 - [Epoch 10 14848/14848][Iteration 290][Wall Clock 17.47923692s] bigdl_metric_0 Loss is (Loss: 31.82238, count: 80, Average Loss: 0.39777976) 2020-12-25 15:52:44 INFO DistriOptimizer$:180 - [Epoch 10 14848/14848][Iteration 290][Wall Clock 17.47923692s] bigdl_metric_1 Top1Accuracy is Accuracy(correct: 8548, count: 10000, accuracy: 0.8548)
| Back | FazBrowse Home | New Git URL |