2

我没有得到 tfma.view.render_plot 来渲染绘图:

tfma.view.render_plot(result) 或者 tfma.view.render_time_series

请注意,tfma.view.render_slicing_metrics确实有效..

我怀疑它与这个 404 有关...我在 jupyter notebook 标准输出日志中收到以下错误:

[W 20:42:09.329 NotebookApp] 404 GET /static/tensorflow_model-analysis.js?v=20201030203829 (192.168.112.1) 14.49ms referer=http://localhost:18888/notebooks/analysis.ipynb

这是在来自 python:3.7-slim-buster (debian) 的 docker 映像中运行的

jupyter 命令:

        /usr/local/airflow/.local/bin/jupyter nbextension enable --py widgetsnbextension --sys-prefix
        /usr/local/airflow/.local/bin/jupyter nbextension install --py --symlink tensorflow_model_analysis --sys-prefix
        /usr/local/airflow/.local/bin/jupyter nbextension enable --py tensorflow_model_analysis --sys-prefix
        /usr/local/airflow/.local/bin/jupyter nbextension install --py --symlink witwidget --sys-prefix
        /usr/local/airflow/.local/bin/jupyter nbextension enable witwidget --py  --sys-prefix

        /usr/local/airflow/.local/bin/jupyter nbextensions_configurator enable --user

        /usr/local/airflow/.local/bin/jupyter notebook --ip=0.0.0.0 --notebook-dir=/usr/local/airflow/dags --port=18888 

版本是:

cat requirements.txt | grep tensor

tensorboard==2.1.1
tensorflow-data-validation==0.21.5
tensorflow-estimator==1.15.1
tensorflow-metadata==0.21.1
tensorflow-model-analysis==0.21.5
#tensorflow-model-analysis==0.22.0
tensorflow-serving-api==2.1.0
tensorflow-transform==0.21.2
tensorflow-gpu==2.1.0
tensorflow-serving-api==2.1.0
tensorflow-datasets==3.1.0
tensorflow-hub==0.9.0

我尝试了 tfma 版本 0.22.0 并得到了相同的结果,其他一切都相同。

这是我的 nbextensions:

airflow@8158874d751e:~$ jupyter nbextension list --debug
Searching ['/usr/local/airflow', '/usr/local/airflow/.jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
Looking for jupyter_config in /etc/jupyter
Looking for jupyter_config in /usr/local/etc/jupyter
Looking for jupyter_config in /usr/local/airflow/.jupyter
Looking for jupyter_config in /usr/local/airflow
Looking for jupyter nbextension list_config in /etc/jupyter
Looking for jupyter nbextension list_config in /usr/local/etc/jupyter
Looking for jupyter nbextension list_config in /usr/local/airflow/.jupyter
Looking for jupyter nbextension list_config in /usr/local/airflow
Known nbextensions:
Paths used for configuration of common: 
        /usr/local/airflow/.jupyter/nbconfig/common.json
Paths used for configuration of notebook: 
        /usr/local/airflow/.jupyter/nbconfig/notebook.json
Paths used for configuration of tree: 
        /usr/local/airflow/.jupyter/nbconfig/tree.json
Paths used for configuration of edit: 
        /usr/local/airflow/.jupyter/nbconfig/edit.json
Paths used for configuration of terminal: 
        /usr/local/airflow/.jupyter/nbconfig/terminal.json
Paths used for configuration of common: 
        /usr/local/etc/jupyter/nbconfig/common.json
Paths used for configuration of notebook: 
        /usr/local/etc/jupyter/nbconfig/notebook.json
  config dir: /usr/local/etc/jupyter/nbconfig
    notebook section
      jupyter-js-widgets/extension  enabled 
      - Validating: OK
      tensorflow_model_analysis/extension  enabled 
      - Validating: OK
      wit-widget/extension  enabled 
      - Validating: OK
Paths used for configuration of tree: 
        /usr/local/etc/jupyter/nbconfig/tree.json
Paths used for configuration of edit: 
        /usr/local/etc/jupyter/nbconfig/edit.json
Paths used for configuration of terminal: 
        /usr/local/etc/jupyter/nbconfig/terminal.json
Paths used for configuration of common: 
        /etc/jupyter/nbconfig/common.json
Paths used for configuration of notebook: 
        /etc/jupyter/nbconfig/notebook.json
Paths used for configuration of tree: 
        /etc/jupyter/nbconfig/tree.json
Paths used for configuration of edit: 
        /etc/jupyter/nbconfig/edit.json
Paths used for configuration of terminal: 
        /etc/jupyter/nbconfig/terminal.json

我发现如果我等待的时间足够长,jupyter 单元在运行 tfma.render_plot 时将返回以下响应:

PlotViewer(config={'sliceName': 'Overall', 'metricKeys': {'calibrationPlot': {'metricName': 'calibrationHistog…

如果需要,我很乐意提供更多信息。非常感谢。

4

0 回答 0