tfx icon indicating copy to clipboard operation
tfx copied to clipboard

TensorFlow-extended: no interactive HTML results generated on databricks

Open umusa opened this issue 4 years ago • 4 comments

Hi, I am trying to run the TensorFlow-extended example code https://www.tensorflow.org/tfx/tutorials/tfx/components_keras

on databricks with env:

   7.1 ML Spark 3.0.0 Scala 2.12 GPU
   tfx==0.22.0
   TensorFlow version: 2.2.0
   py: 3.7
   Unbuntu: 4.4.0

When I run

   context.show(statistics_gen.outputs['statistics'])

I got:

   <IPython.core.display.HTML object>
   <IPython.core.display.HTML object>
   <IPython.core.display.HTML object>
   <IPython.core.display.HTML object>
   <IPython.core.display.HTML object>

I can run

   html="""
  <html lang="en">
  <head>
  <b>'hello'</b>
  </head>
  """
   displayHTML(html)

and got the exptected HTML.

How to get them for the example TFX code ? I have tried IPython.core.display and import html, but it does not work.

thanks

umusa avatar Jul 26 '20 21:07 umusa

@umusa , Can you please confirm if this issue is similar to #2194. Thanks!

rmothukuru avatar Jul 27 '20 08:07 rmothukuru

They are different. For this issue, it is interactive HTML results. For #2194, it is a static HTML without any interactive components.

umusa avatar Jul 27 '20 15:07 umusa

We run the code on AWS/EC2 through databricks.

umusa avatar Jul 27 '20 15:07 umusa

@umusa,

You can try using get_statistics_html that generates the HTML objects and calling those instead of the visualize functions. Then, visualize those functions with the DataBricks displayHTML function.

Hope this helps. Thank you!

Example code below:

from tensorflow_data_validation.utils.display_util import get_statistics_html
displayHTML(get_statistics_html(train_stats))

singhniraj08 avatar Sep 29 '22 10:09 singhniraj08

Closing this due to inactivity. Please take a look into the answers provided above, feel free to reopen and post your comments(if you still have queries on this). Thank you!

singhniraj08 avatar Dec 23 '22 06:12 singhniraj08

Are you satisfied with the resolution of your issue? Yes No

google-ml-butler[bot] avatar Dec 23 '22 06:12 google-ml-butler[bot]