从databricks笔记本运行时,tensoflow data validation visualize_statistics()中未显示html网页

2024-04-28 18:07:07 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试使用tensorflow(2.2)数据验证(TFDV版本:0.22.2)来可视化databricks GPU集群上的数据

在databricks笔记本中,我正在以下位置运行代码: https://nbviewer.jupyter.org/github/tensorflow/tfx/blob/master/docs/tutorials/data_validation/tfdv_basic.ipynb

但是,当我跑的时候

  tfdv.visualize_statistics(train_stats)

我得到:

 <IPython.core.display.HTML object>

没有显示html网页

我已尝试更新matlibplot,但它不起作用

我也试过https://python-forum.io/Thread-How-to-display-IPython-core-display-HTML-objectHow to embed HTML into IPython output?

但仍然没有显示html

有人能帮我吗

谢谢

更新

我试过:

html = tfdv.visualize_statistics(train_stats).data

得到:

<IPython.core.display.HTML object>
AttributeError: 'NoneType' object has no attribute 'data'
---------------------------------------------------------------------------
 AttributeError                            Traceback (most recent call last)
 <command-2488671> in <module>

----->;1 html=tfdv.可视化统计(训练统计)。数据

 AttributeError: 'NoneType' object has no attribute 'data'

Tags: 数据httpscoredataobject可视化tensorflowhtml
1条回答
网友
1楼 · 发布于 2024-04-28 18:07:07

这在jupyter笔记本中非常有效,这是实现此可视化所必需的<;IPython.core.display.HTML对象>

您可以通过以下方式获取HTML代码:

html = tfdv.visualize_statistics(train_stats).data

相关问题 更多 >