![]() ![]() We see that we have our events file that was just written. Let’s also close the TensorFlow session to release the TensorFlow resources we used within the session.įinally, we close Python so we can start TensorBoard from the command line.įirst, let’s check to see if there’s anything in the graph’s directory, so we say ls graphs. Now that we’re done writing the file, let’s close the FileWriter. So we do tf.summary.FileWriter, we are going to write the event file to the graphs folder, and we’re going to pass in our TensorFlow session graph, and we are assigning the FileWriter to the Python variable tf_tensorboard_writer. Tf_tensorboard_writer = tf.summary.FileWriter('./graphs', aph) The way we’ll do this is to use TensorFlow’s summary FileWriter to create a protocol buffer that serializes the structured data so that TensorBoard can later create a visual representation. Next, we want to send our TensorFlow graph to TensorBoard so that we can visualize the graph. Now that we have created our TensorFlow graph, it’s time to run the computational graph.Īnd we initialize all the global variables in the graph, so our constant one, our constant two, and our constant sum. So we use tf.add, we pass in tf_constant_one and tf_constant_two, the resulting summation is assigned to the Python variable tf_constant_sum. Tf_constant_sum = tf.add(tf_constant_one, tf_constant_two) Let’s now build a computational graph node that adds the two constant scalars together. Since we are in the building the graph stage, both of these TensorFlow constant scalars haven’t been evaluated in a TensorFlow session yet. So we use tf.constant, we give it a value of 20, the name we give it is the string of “twenty”, and we assign it to the Python variable tf_constant_two. Tf_constant_two = tf.constant(20, name="twenty") ![]() Next, let’s define our second constant scalar. So we use tf.constant, we give it the value of 10, the name of “ten”, and we assign it to the Python variable tf_constant_one. Tf_constant_one = tf.constant(10, name="ten") The example we’re going to create in this video is to add two named TensorFlow scalars together using the TensorFlow Add operation.įirst, let’s define our first constant scalar. Next, let’s print out what version of TensorFlow we are using. In this video, we’re going to use the TensorFlow summary FileWriter, tf.summary.FileWriter and the TensorBoard command line utility to visualize a TensorFlow graph in the TensorBoard web service. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |