

{"id":17507,"date":"2018-06-08T04:48:26","date_gmt":"2018-06-08T04:48:26","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=17507"},"modified":"2021-05-14T11:00:08","modified_gmt":"2021-05-14T05:30:08","slug":"tensorflow-debugging","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/tensorflow-debugging\/","title":{"rendered":"TensorFlow Debugging &#8211; Commands and Training"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">In our last article, we saw <strong>Embedding in TensorFlow<\/strong>. Today we\u2019ll be learning Debugging in Tensorflow using different methods offered by the machine learning library. Moreover, we will see a brief of TensorFlow Debugging and how to wrap TensorFlow sessions.<\/span><\/p>\n<p>So, let&#8217;s start TensorFlow Debugging.<\/p>\n<h2><span style=\"font-weight: 400;\">TensorFlow Debugging<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Tenosrflow has its own debugger called the tfdbg\u00a0TensorFlow Debugging, which lets you observe the intrinsic working and the state of the running graphs. These are difficult to debug with any other general debuggers like <\/span><span style=\"font-weight: 400;\">pdb<\/span><span style=\"font-weight: 400;\"> in <strong>python<\/strong>.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This tutorial will deal with the command line interface for TensorFlow debugging. There is also a Tensorflow debugging plugin available for users to exploit.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This tutorial will teach you how to use the\u00a0<\/span><i><span style=\"font-weight: 400;\">tfdbg<\/span><\/i><span style=\"font-weight: 400;\">\u00a0CLI to debug the appearance of<strong>\u00a0<\/strong><\/span><strong>nans<\/strong><span style=\"font-weight: 400;\"><strong>\u00a0<\/strong>and\u00a0<\/span><strong>infs<\/strong><span style=\"font-weight: 400;\">, which are the most common type of bugs found in tensorflow. Given below is a low-level API example<\/span><span style=\"font-weight: 400;\">:<\/span><br \/>\n<strong>python -m tensorflow.python.debug.examples.debug_mnist<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">The code given above will train a neural network for<strong> MNIST<\/strong> digit <strong>image recognition <\/strong>and the accuracy increases slightly before saturating after a number of steps.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This error may be due to the\u00a0<\/span><span style=\"font-weight: 400;\">inf<\/span><span style=\"font-weight: 400;\">s and\u00a0<\/span><span style=\"font-weight: 400;\">nan<\/span><span style=\"font-weight: 400;\">s, which are the most common bugs. Now, let&#8217;s use tfdbg to debug the issue and know where exactly the problem began.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Wrapping TensorFlow Sessions With tfdbg<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Add the following lines of code to use tfdbg and then contain the Session object using a debugger wrapper.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">from<\/span><span style=\"font-weight: 400;\"> tensorflow.python <\/span><span style=\"font-weight: 400;\">import<\/span><span style=\"font-weight: 400;\"> debug <\/span><span style=\"font-weight: 400;\">as<\/span><span style=\"font-weight: 400;\"> tf_debug<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">sess = tf_debug.LocalCLIDebugWrapperSession(sess)<\/pre>\n<p><span style=\"font-weight: 400;\">This wrapper offers some added features, which include:<\/span><br \/>\n<span style=\"font-weight: 400;\">CLI should be called before and after\u00a0<\/span><span style=\"font-weight: 400;\">Session<\/span><span style=\"font-weight: 400;\">.run()<\/span><span style=\"font-weight: 400;\">\u00a0if you wish to take control of the execution and know the internal state of the graph.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Filters can be added for assisting the diagnosis and in the provided example, there is already a filter called\u00a0<\/span><strong>tfdbg.has_inf_or_nan<\/strong><span style=\"font-weight: 400;\">, which determine the presence of\u00a0<\/span><span style=\"font-weight: 400;\">nan<\/span><span style=\"font-weight: 400;\">\u00a0or\u00a0<\/span>inf in<span style=\"font-weight: 400;\"> any in-between tensors, which are neither inputs nor outputs.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You are always free to write your own code for custom filters that suit your needs and you can look at the API documentation for additional information for the same.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Debugging TensorFlow Model Training with tfdbg<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Now, it\u2019s time to train the model with including the\u00a0<\/span><span style=\"font-weight: 400;\">&#8211;debug<\/span><span style=\"font-weight: 400;\">\u00a0flag:<\/span><\/p>\n<p><strong>python -m tensorflow.python.debug.examples.debug_mnist &#8211;debug<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">The fetched data will be displayed on the screen and will look something like the image shown below:<\/span><\/p>\n<div id=\"attachment_17565\" style=\"width: 572px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/cli.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-17565\" class=\"wp-image-17565 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/cli.png\" alt=\"TensorFlow Debugging\" width=\"562\" height=\"422\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/cli.png 562w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/cli-150x113.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/cli-300x225.png 300w\" sizes=\"auto, (max-width: 562px) 100vw, 562px\" \/><\/a><p id=\"caption-attachment-17565\" class=\"wp-caption-text\">Debugging TensorFlow Model Training with tfdbg<\/p><\/div>\n<p><span style=\"font-weight: 400;\">The above picture is the\u00a0<\/span><i><span style=\"font-weight: 400;\">run-start <\/span><\/i><span style=\"font-weight: 400;\">interface. <\/span><span style=\"font-weight: 400;\">After this, enter the\u00a0<\/span><span style=\"font-weight: 400;\">run<\/span><span style=\"font-weight: 400;\">\u00a0or <\/span><span style=\"font-weight: 400;\">r<\/span><span style=\"font-weight: 400;\"> at the prompt:<\/span><\/p>\n<p><strong>tfdbg&gt; run<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">This will make the Tensorflow debugger run till the next\u00a0session call, calculating the accuracy for the test dataset. The debugger will display the ditched tensors in the\u00a0run-end interface. For example<\/span><span style=\"font-weight: 400;\">:<\/span><\/p>\n<div id=\"attachment_17566\" style=\"width: 571px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/cl1-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-17566\" class=\"wp-image-17566 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/cl1-1.png\" alt=\"TensorFlow Debugging\" width=\"561\" height=\"300\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/cl1-1.png 561w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/cl1-1-150x80.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/cl1-1-300x160.png 300w\" sizes=\"auto, (max-width: 561px) 100vw, 561px\" \/><\/a><p id=\"caption-attachment-17566\" class=\"wp-caption-text\">ditched tensors in the run-end interface<\/p><\/div>\n<p><span style=\"font-weight: 400;\">You can list the tensors using <\/span><i><span style=\"font-weight: 400;\">lt<\/span><\/i><span style=\"font-weight: 400;\"> command after you\u2019ve executed run.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Frequently-Used TensorFlow Debugging Commands<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Attempt the following commands at the tfdbg&gt; prompt (referencing the code at tensorflow\/python\/debug\/examples\/debug_mnist.Py):<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Note that whenever you enter a command, a brand new display output will seem. That is incredibly analogous to internet pages in a browser. You may navigate between those screens through clicking the &lt;&#8211; and &#8211;&gt; text arrows close to the top-left corner of the CLI.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Features of tfdbg CLI<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Similarly to the TensorFlow Debugging commands indexed above, the tfdbg CLI gives the subsequent additional capabilities:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To navigate thru preceding tfdbg instructions, type in some characters accompanied by the Up or Down arrow keys. Tfdbg will show you the history of instructions that commenced with the ones characters.<\/span><br \/>\n<span style=\"font-weight: 400;\">To navigate thru the records of screen outputs, do both of the following:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Use the prev and next commands.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Click underlined &lt;&#8211; and &#8211;&gt; hyperlinks close to the pinnacle left corner of the display screen.<\/span><br \/>\n<span style=\"font-weight: 400;\">Tab final touch of commands and some command arguments.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To redirect the display screen output to a record in preference to the screen, quit the command with bash-style redirection. For instance, the subsequent command redirects the output of the pt command to the <\/span><\/p>\n<pre class=\"EnlighterJSRAW\">\/tmp\/xent_value_slices.txtfile:\r\ntfdbg&gt; pt cross_entropy\/Log:0[:, 0:10] &gt; \/tmp\/xent_value_slices.txt<\/pre>\n<h2><span style=\"font-weight: 400;\">Finding <\/span><span style=\"font-weight: 400;\">nan<\/span><span style=\"font-weight: 400;\">s<\/span><span style=\"font-weight: 400;\"> and\u00a0<\/span><span style=\"font-weight: 400;\">infs<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">On this first consultation Run() call, there take place to be no intricate numerical values. You could move on to the following run by the usage of the command run or its shorthand r.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>TIP:<\/strong> if you enter run or r repeatedly, you&#8217;ll be able to circulate thru the consultation.Run() calls in a sequential manner.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You can additionally use the -t flag to transport before and some of the session.Run() calls at a time, as an instance:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">tfdbg&gt; run -t 10<\/pre>\n<p><span style=\"font-weight: 400;\">Rather than entering run repeatedly and manually searching for nans and infs inside the run-quit UI after every session.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Run() name (as an example, through the use of the pt command proven within the table above), you may use the following command to permit the debugger, again and again, execute consultation.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Run() calls without stopping at the run-start or run-stop activate, till the primary nan or inf value suggests up in the graph. That is analogous to conditional breakpoints in some procedural-language debuggers:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">tfdbg&gt; run -f has_inf_or_nan<\/pre>\n<p><span style=\"font-weight: 400;\"><strong>Observe:\u00a0<\/strong>The preceding command works nicely because a tensor clears out known as has_inf_or_nan has been registered for you when the wrapped consultation is created. This clear out detects nans and infs (as defined previously). <\/span><\/p>\n<p><span style=\"font-weight: 400;\">If you have registered some other filters, you could use &#8220;run -f&#8221; to have tfdbg run until any tensor triggers that filter (purpose the filter out to go back true).<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">def my_filter_callable(datum, tensor):\r\n   return len(tensor.shape) == 0 and tensor == 0.0\r\nsess.add_tensor_filter('my_filter', my_filter_callable)\r\nThen at the tfdbg run-start prompt run until your filter is precipitated:\r\ntfdbg&gt; run -f my_filter<\/pre>\n<p><span style=\"font-family: Verdana, Geneva, sans-serif;\">See this API document for more statistics at the expected signature and go back a value of the predicate Callable used with add_tensor_filter().<\/span><\/p>\n<div id=\"attachment_17567\" style=\"width: 578px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/cl2-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-17567\" class=\"wp-image-17567 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/cl2-1.png\" alt=\"TensorFlow Debugging\" width=\"568\" height=\"170\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/cl2-1.png 568w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/cl2-1-150x45.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/cl2-1-300x90.png 300w\" sizes=\"auto, (max-width: 568px) 100vw, 568px\" \/><\/a><p id=\"caption-attachment-17567\" class=\"wp-caption-text\">TensorFlow Debugging &#8211; Finding nans and infs<\/p><\/div>\n<p><span style=\"font-weight: 400;\">Because the display show suggests on the primary line, the has_inf_or_nan filter out is first brought about throughout the fourth consultation.Run() call: an Adam optimizer ahead-backward education skip at the graph. In this run, 36 (out of the full ninety-five) intermediate tensors incorporate nan or inf values. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">These tensors are indexed in chronological order, with their timestamps displayed at the left. On the pinnacle of the listing, you can see the first tensor in which the horrific numerical values first surfaced: cross_entropy\/Log:zero.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To view the price of the tensor, click the underlined tensor name cross_entropy\/Log:0 or enter the equivalent command:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">tfdbg&gt; pt cross_entropy\/Log:0<\/pre>\n<p><span style=\"font-weight: 400;\">Scroll down a touch and you&#8217;ll word some scattered inf values. If the instances of inf and nan are hard to identify by eye, you may use the following command to perform a regex seek and spotlight the output:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">tfdbg&gt; \/inf<\/pre>\n<p><span style=\"font-weight: 400;\">Or, as a substitute:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">tfdbg&gt; \/(inf|nan)<\/pre>\n<p><span style=\"font-weight: 400;\">You can additionally use the -s or &#8211;numeric_summary command to get a brief summary of the sorts of numeric values within the tensor:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">tfdbg&gt; pt -s cross_entropy\/Log:0<\/pre>\n<p><span style=\"font-weight: 400;\">From the precis, you can see that several of the thousand elements of the cross_entropy\/Log:zero tensor are -infs (negative infinities).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Why did those infinities appear? To further debug, show more information approximately the node cross_entropy\/Log via clicking the underlined node_info menu item on the pinnacle or getting into the equivalent node_info (ni) command:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">tfdbg&gt; ni cross_entropy\/Log<\/pre>\n<div id=\"attachment_17568\" style=\"width: 577px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/cl3.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-17568\" class=\"wp-image-17568 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/cl3.png\" alt=\"TensorFlow Debugging\" width=\"567\" height=\"168\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/cl3.png 567w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/cl3-150x44.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/cl3-300x89.png 300w\" sizes=\"auto, (max-width: 567px) 100vw, 567px\" \/><\/a><p id=\"caption-attachment-17568\" class=\"wp-caption-text\">TensorFlow Debugging<\/p><\/div>\n<p><span style=\"font-family: Verdana, Geneva, sans-serif;\">You can see that this node has the op type log and that its input is the node Softmax. Run the subsequent command to take a more in-depth observe the input tensor:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">tfdbg&gt; pt Softmax:0<\/pre>\n<p><span style=\"font-weight: 400;\">Have a look at the values in the enter tensor, looking for zeros:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">tfdbg&gt; \/0\\.000<\/pre>\n<p><span style=\"font-weight: 400;\">Indeed, there are zeros. Now it is clean that the foundation of the terrible numerical values is the node cross_entropy\/Log talking logs of zeros. To find out the wrongdoer line within the Python supply code, use the -t flag of the ni command to show the traceback of the node&#8217;s production:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">tfdbg&gt; ni -t cross_entropy\/Log<\/pre>\n<p><span style=\"font-weight: 400;\">In case you click &#8220;node_info&#8221; at the top of the display, tfdbg mechanically suggests the traceback of the node&#8217;s creation.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">From the traceback, you can see that the op is built at the following line: debug_mnist.Py:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">diff = y_ * tf.log(y)<\/pre>\n<p><span style=\"font-weight: 400;\">Tfdbg has a feature that makes it easy to trace Tensors and ops again to lines in Python supply documents. It is able to annotate lines of a Python record with the ops or Tensors created with the aid of them. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">To use this selection, without a doubt click the underlined line numbers in the stack trace output of the ni -t &lt;op_name&gt; instructions, or use the PlayStation \u00a0(or print_source) command along with: ps \/course\/to\/source.Py. As an instance, the subsequent screenshot indicates the output of a ps command.<\/span><\/p>\n<div id=\"attachment_17574\" style=\"width: 577px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/cl4-1.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-17574\" class=\"wp-image-17574 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/cl4-1.png\" alt=\"TensorFlow Debugging\" width=\"567\" height=\"164\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/cl4-1.png 567w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/cl4-1-150x43.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/cl4-1-300x87.png 300w\" sizes=\"auto, (max-width: 567px) 100vw, 567px\" \/><\/a><p id=\"caption-attachment-17574\" class=\"wp-caption-text\">TensorFlow Debugging<\/p><\/div>\n<h2><span style=\"font-weight: 400;\">Fixing Problem in TensorFlow Debugging<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">To restore the problem, edit debug_mnist.Py, changing the unique line:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">diff = -(y_ * tf.log(y))<\/pre>\n<p><span style=\"font-weight: 400;\">To the built-in, numerically-stable implementation of softmax move-entropy:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">diff = tf.losses.sparse_softmax_cross_entropy(labels=y_, logits=logits)<\/pre>\n<p><span style=\"font-weight: 400;\">Rerun with the\u00a0&#8211;debug\u00a0flag as follows<\/span><span style=\"font-weight: 400;\">:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">python -m tensorflow.python.debug.examples.debug_mnist --debug<\/pre>\n<p><span style=\"font-weight: 400;\">At the\u00a0<\/span><span style=\"font-weight: 400;\">tfdbg&gt;<\/span><span style=\"font-weight: 400;\">\u00a0prompt, enter the following command:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">run -f has_inf_or_nan<\/pre>\n<p><span style=\"font-weight: 400;\">Affirm that no tensors are flagged as containing nan or inf values, and accuracy now maintains to rise as opposed to getting stuck. Success!<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Debugging tf-learn Estimators and Experiments<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">This phase explains the way to debug TensorFlow packages that use the Estimator and test APIs. A part of the convenience supplied by way of these APIs is that they manage classes internally. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">This makes the LocalCLIDebugWrapperSession defined in the preceding sections inapplicable. Luckily, you may nonetheless debug them by means of the usage of unique hooks provided via tfdbg.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Debugging tf.contrib.learn Estimators<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Presently, tfdbg can debug the fit() evaluate() methods of tf-examine Estimators. To debug Estimator.Suit(), create a LocalCLIDebugHook and supply it in the video display units argument. As an example:<\/span><\/p>\n<p><strong>from tensorflow.python import debug as tf_debug<\/strong><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">hooks = [tf_debug.LocalCLIDebugHook()]\r\nclassifier.fit(x=training_set.data,\r\n               y=training_set.target,\r\n               steps=1000,\r\n               monitors=hooks)<\/pre>\n<p><span style=\"font-weight: 400;\">To debug Estimator.Examine(), assign hooks to the hooks parameter, as inside the following instance:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">accuracy_score = classifier.evaluate(x=test_set.data,\r\n                                     y=test_set.target,\r\n                                     hooks=hooks)[\"accuracy\"]<\/pre>\n<p><span style=\"font-weight: 400;\">Debug_tflearn_iris.Py, based on tf-research&#8217;s iris tutorial, contains a full example of the way to use the tfdbg with Estimators. To run this case, do:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">python -m tensorflow.python.debug.examples.debug_tflearn_iris --debug<\/pre>\n<h2><span style=\"font-weight: 400;\">Debugging tf.contrib.learn Experiments<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">An experiment is an assembly in tf.Contrib.Examine at a better degree than Estimator. It gives a single interface for education and comparing a model.<\/span><\/p>\n<p><span style=\"font-weight: 400;\"> To debug the teach() and evaluate() calls to an test object, you can use the keyword arguments train_monitors and eval_hooks, respectively, when calling its constructor. As an example:<\/span><\/p>\n<p><strong>from tensorflow.python import debug as tf_debug<\/strong><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">hooks = [tf_debug.LocalCLIDebugHook()]\r\nex = experiment.Experiment(classifier,\r\n                           train_input_fn=iris_input_fn,\r\n                           eval_input_fn=iris_input_fn,\r\n                           train_steps=FLAGS.train_steps,\r\n                           eval_delay_secs=0,\r\n                           eval_steps=1,\r\n                           train_monitors=hooks,\r\n                           eval_hooks=hooks)\r\nex.train()\r\naccuracy_score = ex.evaluate()[\"accuracy\"]<\/pre>\n<p><span style=\"font-weight: 400;\">To build and run the debug_tflearn_iris example inside the experiment mode, do:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">python -m tensorflow.python.debug.examples.debug_tflearn_iris \\\r\n    --use_experiment --debug<\/pre>\n<p><span style=\"font-weight: 400;\">The LocalCLIDebugHook also allows you to configure a watch_fn that can be used to flexibly specify what Tensors to watch on one of a kind session.Run() calls, as a characteristic of the fetches and feed_dict and different states. See this API doc for more info.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Debugging Keras Models with TFDBG<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">To use TFDBG with Keras, allow the Keras backend use a TFDBG-wrapped consultation item. As an instance, to use the CLI wrapper:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">import tensorflow as tf\r\nfrom keras import backend as keras_backend\r\nfrom tensorflow.python import debug as tf_debug\r\nkeras_backend.set_session(tf_debug.LocalCLIDebugWrapperSession(tf.Session()))\r\n# Define your keras model, called \"model\".\r\nmodel.fit(...)  # This will break into the TFDBG CLI.<\/pre>\n<h2><span style=\"font-weight: 400;\">Debugging tf-slim with TFDBG<\/span><\/h2>\n<p>TFDBG supports debugging of training and evaluation with\u00a0<strong>tf-slim<\/strong>. As detailed below, training and evaluation require slightly different debugging workflows.<\/p>\n<h2><span style=\"font-weight: 400;\">Debugging training in tf-slim<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">TFDBG supports TensorFlow debugging of training and evaluation with tf-slender. As particular below, training and evaluation require slightly special TensorFlow debugging workflows.<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">import tensorflow as tf\r\nfrom tensorflow.python import debug as tf_debug\r\n# ... Code that creates the graph and the train_op ...\r\ntf.contrib.slim.learning.train(\r\n    train_op,\r\n    logdir,\r\n    number_of_steps=10,\r\n    session_wrapper=tf_debug.LocalCLIDebugWrapperSession)<\/pre>\n<h2><span style=\"font-weight: 400;\">Debugging evaluation in tf-slim<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">To debug the schooling system, offer LocalCLIDebugWrapperSession to the session_wrapper argument of slender.Mastering.Educate(). As an instance:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">import tensorflow as tf\r\nfrom tensorflow.python import debug as tf_debug\r\n# ... Code that creates the graph and the eval and final ops ...\r\ntf.contrib.slim.evaluation.evaluate_once(\r\n    '',\r\n    checkpoint_path,\r\n    logdir,\r\n    eval_op=my_eval_op,\r\n    final_op=my_value_op,\r\n    hooks=[tf_debug.LocalCLIDebugHook()])<\/pre>\n<h2><span style=\"font-weight: 400;\">Offline Debugging of Remotely-Running Sessions<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Often, your version is going for walks on a faraway machine or a method that you do not have terminal access to. To perform version TensorFlow debugging in such instances, you may use the offline_analyzer binary of tfdbg (described under). <\/span><\/p>\n<p><span style=\"font-weight: 400;\">It operates on dumped facts directories. This could be done to both the lower-level session API and the better-degree Estimator and test APIs.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Debugging Remote tf.Sessions<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">In case you have interaction without delay with the tf.Session API in python, you can configure the RunOptions proto that you call your session.Run() technique with, via the usage of the approach tfdbg.Watch_graph. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">Further, this will purpose the intermediate tensors and runtime graphs to be dumped to a shared storage location of your choice whilst the session.Run() name occurs (on the fee of slower overall performance). For instance:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">from<\/span><span style=\"font-weight: 400;\"> tensorflow.python <\/span><span style=\"font-weight: 400;\">import<\/span><span style=\"font-weight: 400;\"> debug <\/span><span style=\"font-weight: 400;\">as<\/span><span style=\"font-weight: 400;\"> tf_debug<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/p>\n<pre class=\"EnlighterJSRAW\"># ... Code where your session and graph are set up...\r\nrun_options = tf.RunOptions()\r\ntf_debug.watch_graph(\r\n      run_options,\r\n      session.graph,\r\n      debug_urls=[\"file:\/\/\/shared\/storage\/location\/tfdbg_dumps_1\"])\r\n# Be sure to specify different directories for different run() calls.\r\nsession.run(fetches, feed_dict=feeds, options=run_options)<\/pre>\n<p><span style=\"font-weight: 400;\">Later, in an surroundings that you have terminal access to (as an instance, a nearby laptop that can get admission to the shared garage location exact within the code above), you could load and inspect the records in the sell off directory at the shared storage by way of the use of the offline_analyzer binary of tfdbg. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">As an example:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">python -m tensorflow.python.debug.cli.offline_analyzer \\\r\n    --dump_dir=\/shared\/storage\/location\/tfdbg_dumps_1<\/pre>\n<p><span style=\"font-weight: 400;\">The session wrapper DumpingDebugWrapperSession gives an easier and greater bendy manner to generate document-system dumps that may be analyzed offline. To apply it, actually wrap your consultation in a tf_debug.DumpingDebugWrapperSession. As an example:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">from tensorflow.python import debug as tf_debug\r\nsess = tf_debug.DumpingDebugWrapperSession(\r\n    sess, \"\/shared\/storage\/location\/tfdbg_dumps_1\/\", watch_fn=my_watch_fn)<\/pre>\n<p><span style=\"font-weight: 400;\">The watch_fn argument accepts a Callable that permits you to configure what tensors to observe on distinct consultation.Run() calls, as a function of the fetches and feed_dict to the run() name and different states.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">C++ and other languages<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">If your version code is written in C++ or other languages, you can additionally modify the debug_options subject of RunOptionsto generate debug dumps that can be inspected offline. See the proto definition for extra information.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Debugging Remotely-Running tf-learn Estimators and Experiments<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">If your far off TensorFlow server runs Estimators, you could use the non-interactive DumpingDebugHook. As an instance:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">from<\/span><span style=\"font-weight: 400;\"> tensorflow.python <\/span><span style=\"font-weight: 400;\">import<\/span><span style=\"font-weight: 400;\"> debug <\/span><span style=\"font-weight: 400;\">as<\/span><span style=\"font-weight: 400;\"> tf_debug<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">hooks = [tf_debug.DumpingDebugHook(\"\/shared\/storage\/location\/tfdbg_dumps_1\")]<\/pre>\n<p><span style=\"font-weight: 400;\">Then this hook may be used in the same manner because the LocalCLIDebugHook examples described earlier on this file. As the education and\/or evalution of Estimator or experiment takes place, tfdbg creates directories having the following call sample: <\/span><\/p>\n<p><span style=\"font-weight: 400;\"><strong>\/shared\/garage\/place\/tfdbg_dumps_1\/run_&lt;epoch_timestamp_microsec&gt;_&lt;uuid&gt;<\/strong>. Each listing corresponds to a session.Run() name that underlies the suit() or compare() call. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">You can load those directories and inspect them in a command-line interface in an offline way the usage of the offline_analyzer supplied by tfdbg. As an instance:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\">python -m tensorflow.python.debug.cli.offline_analyzer \\\r\n    --dump_dir=\"\/shared\/storage\/location\/tfdbg_dumps_1\/run_&lt;epoch_timestamp_microsec&gt;_&lt;uuid&gt;\"<\/pre>\n<p>So, this was all about TensorFlow Debugging. Hope you like our explanation.<\/p>\n<h2><span style=\"font-weight: 400;\">Conclusion<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Hence, in this TensorFlow Debugging tutorial, we saw how to debug your code using different methods, classes, and APIs as well as the meanings of these representations. <\/span><\/p>\n<p><span style=\"font-weight: 400;\">Moreover, we discussed different commands in TensorFlow Debugging. Next up is the tutorial on visualizing the graphs in tensorflow, aka, tensorboard. Still, if any doubt, feel free to ask in the comment tab.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In our last article, we saw Embedding in TensorFlow. Today we\u2019ll be learning Debugging in Tensorflow using different methods offered by the machine learning library. Moreover, we will see a brief of TensorFlow Debugging&#46;&#46;&#46;<\/p>\n","protected":false},"author":6,"featured_media":17570,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73],"tags":[2264,3593,3595,3596,3599,3600,3602,4644,4714,4729,14537],"class_list":["post-17507","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tensorflow","tag-c-and-other-languages","tag-debugging-evaluation-in-tf-slim","tag-debugging-remote-tf-sessions","tag-debugging-remotely","tag-debugging-tf-slim-with-tfdbg","tag-debugging-tf-contrib-learn-estimators","tag-debugging-training-in-tf-slim","tag-features-of-tfdbg-cli","tag-finding-nans-and-infs","tag-fixing-the-problem","tag-tensorflow-debugging"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>TensorFlow Debugging - Commands and Training - DataFlair<\/title>\n<meta name=\"description\" content=\"TensorFlow Debugging tutorial,Model Training,Offline Debugging of Remotely-Running Sessions, Debugging Keras Models with TFDBG, Wrapping Sessions with tfdbg\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/tensorflow-debugging\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"TensorFlow Debugging - Commands and Training - DataFlair\" \/>\n<meta property=\"og:description\" content=\"TensorFlow Debugging tutorial,Model Training,Offline Debugging of Remotely-Running Sessions, Debugging Keras Models with TFDBG, Wrapping Sessions with tfdbg\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/tensorflow-debugging\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-06-08T04:48:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-05-14T05:30:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Tensorflow-Debugging.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"TensorFlow Debugging - Commands and Training - DataFlair","description":"TensorFlow Debugging tutorial,Model Training,Offline Debugging of Remotely-Running Sessions, Debugging Keras Models with TFDBG, Wrapping Sessions with tfdbg","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/tensorflow-debugging\/","og_locale":"en_US","og_type":"article","og_title":"TensorFlow Debugging - Commands and Training - DataFlair","og_description":"TensorFlow Debugging tutorial,Model Training,Offline Debugging of Remotely-Running Sessions, Debugging Keras Models with TFDBG, Wrapping Sessions with tfdbg","og_url":"https:\/\/data-flair.training\/blogs\/tensorflow-debugging\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2018-06-08T04:48:26+00:00","article_modified_time":"2021-05-14T05:30:08+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Tensorflow-Debugging.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"13 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/tensorflow-debugging\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/tensorflow-debugging\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89"},"headline":"TensorFlow Debugging &#8211; Commands and Training","datePublished":"2018-06-08T04:48:26+00:00","dateModified":"2021-05-14T05:30:08+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/tensorflow-debugging\/"},"wordCount":2438,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/tensorflow-debugging\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Tensorflow-Debugging.jpg","keywords":["C++ and other languages","Debugging evaluation in tf-slim","Debugging Remote tf.Sessions","Debugging Remotely","Debugging tf-slim with TFDBG","Debugging tf.contrib.learn Estimators","Debugging training in tf-slim","Features of tfdbg CLI","Finding nans and infs","Fixing the problem","TensorFlow Debugging"],"articleSection":["Tensorflow Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/tensorflow-debugging\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/tensorflow-debugging\/","url":"https:\/\/data-flair.training\/blogs\/tensorflow-debugging\/","name":"TensorFlow Debugging - Commands and Training - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/tensorflow-debugging\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/tensorflow-debugging\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Tensorflow-Debugging.jpg","datePublished":"2018-06-08T04:48:26+00:00","dateModified":"2021-05-14T05:30:08+00:00","description":"TensorFlow Debugging tutorial,Model Training,Offline Debugging of Remotely-Running Sessions, Debugging Keras Models with TFDBG, Wrapping Sessions with tfdbg","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/tensorflow-debugging\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/tensorflow-debugging\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/tensorflow-debugging\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Tensorflow-Debugging.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/06\/Tensorflow-Debugging.jpg","width":1200,"height":628,"caption":"TensorFlow Debugging - Commands and Training"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/tensorflow-debugging\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Tensorflow Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/tensorflow\/"},{"@type":"ListItem","position":3,"name":"TensorFlow Debugging &#8211; Commands and Training"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"The DataFlair Team provides industry-driven content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our expert educators focus on delivering value-packed, easy-to-follow resources for tech enthusiasts and professionals.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam2\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/17507","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=17507"}],"version-history":[{"count":8,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/17507\/revisions"}],"predecessor-version":[{"id":94568,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/17507\/revisions\/94568"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/17570"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=17507"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=17507"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=17507"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}