<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Deploying to the Browser using TensorFlow.js
https
Step1:  Loading and validating our model
Step2:  Descison Boundaries for 2 Dimensions
Step3:  Converting our Keras Model to TensorFlow.js
Step4:  Use the command line tool
Does not always give the best error messages, but seems more robust than the Python API
<ASSISTANT_TASK:>
Python Code:
import warnings
warnings.filterwarnings('ignore')
%matplotlib inline
%pylab inline
import matplotlib.pyplot as plt
import pandas as pd
print(pd.__version__)
import tensorflow as tf
tf.logging.set_verbosity(tf.logging.ERROR)
print(tf.__version__)
# let's see what compute devices we have available, hopefully a GPU 
sess = tf.Session()
devices = sess.list_devices()
for d in devices:
    print(d.name)
# a small sane check, does tf seem to work ok?
hello = tf.constant('Hello TF!')
print(sess.run(hello))
Explanation: Deploying to the Browser using TensorFlow.js
https://js.tensorflow.org/tutorials/import-keras.html
End of explanation
!curl -O https://raw.githubusercontent.com/DJCordhose/ai/master/notebooks/manning/model/insurance.hdf5
model = tf.keras.models.load_model('insurance.hdf5')
Explanation: Loading and validating our model
End of explanation
# a little sane check, does it work at all?
# within this code, we expect Olli to be a green customer with a high prabability
# 0: red
# 1: green
# 2: yellow
olli_data = [100, 47, 10]
X = np.array([olli_data])
model.predict(X)
Explanation: Descison Boundaries for 2 Dimensions
End of explanation
!pip install tensorflowjs
Explanation: Converting our Keras Model to TensorFlow.js
End of explanation
!rm -rf tfjs
!mkdir tfjs
!tensorflowjs_converter --input_format keras \
                       ./model/insurance.hdf5 \
                       ./tfjs
Explanation: Use the command line tool
Does not always give the best error messages, but seems more robust than the Python API
End of explanation
<END_TASK>