tfma.view.render_plot无法在Jupyter中渲染,在GET上获取404 /static/tensorflow_model-analysis.js?v=2020103020382

问题描述

我没有让tfma.view.render_plot来渲染具有以下内容的图:

tfma.view.render_plot(result) 要么 tfma.view.render_time_series

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

我怀疑它与此404有关...在jupyter笔记本stdout日志中出现以下错误:

[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

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

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

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

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...