<jupyter_start><jupyter_text>Visual Wake Words Model Trainer Run as a Jupyter notebook on the GCP AI platform : TF 1.0 : GPU + CUDA Note : there are explicit calls to /device:GPU:0 so running the training script on a CPU will exception  Simple test for GPU presence...<jupyter_code>import tensorflow as tf

with tf.device('/cpu:0'):
    a_c = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a-cpu')
    b_c = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b-cpu')
    c_c = tf.matmul(a_c, b_c, name='c-cpu')
with tf.device('/gpu:0'):
    a_g = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a-gpu')
    b_g = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b-gpu')
    c_g = tf.matmul(a_g, b_g, name='c-gpu')
with tf.Session(config=tf.ConfigProto(log_device_placement=True)) as sess:
    print (sess.run(c_c))
    print (sess.run(c_g))
    
print 'DONE!'<jupyter_output><empty_output><jupyter_text>Train the model after buidling the dataset Note : this can take days on a GPU but useable accuracy should be reached after a few hours<jupyter_code>! python models/research/slim/train_image_classifier.py \
    --train_dir=vww_96_grayscale \
    --dataset_name=visualwakewords \
    --dataset_split_name=train \
    --dataset_dir=./visualwakewords \
    --model_name=mobilenet_v1_025 \
    --preprocessing_name=mobilenet_v1 \
    --train_image_size=96 \
    --input_grayscale=True \
    --save_summaries_secs=300 \
    --learning_rate=0.045 \
    --label_smoothing=0.1 \
    --learning_rate_decay_factor=0.98 \
    --num_epochs_per_decay=2.5 \
    --moving_average_decay=0.9999 \
    --batch_size=96 \
    --max_number_of_steps=1000000<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1574074074074074, 'fraction_numerical': 0.056712962962962965, 'mean_word_length': 3.4792746113989637, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '510257', 'license': 'Apache-2.0', 'n_tokens_mistral': 755, 'n_tokens_neox': 699, 'n_words': 148, 'path': 'tensorflow/lite/micro/examples/object_detection/vww_model_trainer.ipynb', 'repo_name': 'cloudwiser/tensorflow', 'size': '1728'}