HFAiLab/jupyterlab_tensorboard_pro

jupyterlab_tensorboard_pro无反应

bone-11 opened this issue · 10 comments

你好,我的系统是centos 7,python版本是3.8.13,jupyterlab版本是3.4.4,点开tensorboard后一直停留在initializing页面

这个问题常见的原因是没有在该环境安装 tensorboard 和 tensorflow,请先安装 tensorboard 和 tensorflow 试试。

为了能兼容多个版本的 tensorboard 和 tensorflow,我们并未将其列为依赖列表,所以需要用户手动安装。

STHSF commented

tensorboard==2.7.0
tensorflow==2.4.1
jupyterlab==3.2.8
jupyterlab-tensorboard-pro==0.3.1
点开tensorboard之后也是一直停留在initializing页面

我试了下相同的版本,是可以的,停留在 initializing 的主要原因是找不到插件后端(这个可能的原因是,依赖未安装成功或者 jupyterlab-tensorboard-pro 的插件后端未安装成功)。

我这里提供一个定位方案:

  1. 在对应 python (可以通过 which python 确认当前使用的 python 路径)文件的后端找是否有如下的文件: etc/jupyter/jupyter_server_config.d/jupyterlab_tensorboard_pro.json

里面应该有如下内容

{
  "ServerApp": {
    "jpserver_extensions": {
      "jupyterlab_tensorboard_pro": true
    }
  }
}
  1. 然后看一下 lib/python3.8/site-packages/jupyterlab_tensorboard_pro 是否存在,里面应该有 handler.py 在内的几个 python 文件。

  2. 这两处文件都存在,说明应该是能够安装成功的,在启动 jupyter lab 的时候,应该会打印这样的日志:

[I 2022-09-17 17:52:08.559 ServerApp] jupyterlab_tensorboard_pro | extension was successfully linked.

失败的话也会打印对应的日志,可以确认下。

辛苦可以按照如上方式进行验证,如果有不符合预期的行为,可以在这里继续交流~

STHSF commented

我这边启动的是jupyterhub,1、2两步的配置文件和代码文件都是存在的。启动时报如下的错误:

19:09:36.719 [ConfigProxy] info: Proxying http://*:8000 to (no default)
19:09:36.721 [ConfigProxy] info: Proxy API at http://127.0.0.1:8001/api/routes
19:09:39.609 [ConfigProxy] error: 404 GET /user/liyu/api/tensorboard_pro?1663412979272
19:09:39.614 [ConfigProxy] error: Failed to get custom error page: Error: connect ECONNREFUSED 127.0.0.1:8081
19:09:46.846 [ConfigProxy] info: 200 GET /api/routes

STHSF commented

我在用户账号下启动jupyterhub是没有问题的。但是使用root账号安装和启动jupyterhub,然后通过用户账号登陆就会出问题。

404 GET /user/liyu/api/tensorboard_pro?1663412979272 这个情况比较像是没有路由到插件后端,也可能是插件初始化失败了(暂时不清楚是不是和权限有关,抑或 jupyterhub 下的适配问题)。

接下来我这边会尝试在 jupyterhub 环境试试你的问题


其他:

建议启动 jupyter 的时候可以增加 --debug 参数

这个时候一个是可以在标准输出里搜搜 jupyterlab_tensorboard_pro, 有可能会显示出没有 link 成功的日志。

STHSF commented

今天我简单搭建了一个模拟环境,没有复现这个问题:

  1. 使用 CentOS Linux release 7.4,有两个用户,一个 root,一个普通用户
  2. 使用 Root 用户
  3. 安装 MiniConda 到 /opt/conda
  4. 安装 jupyterhub、jupyterlab、tensorboard、jupyter-tensorboard-pro 等
  5. 启动 jupyterhub jupyterhub --ip=0.0.0.0
  6. 在浏览器使用普通用户登录

这个时候 tensborboard 相关插件是可以用的,会提示加载成功:

[I 2022-09-19 20:59:08.448 SingleUserLabApp handlers:52] jupyterlab_tensorboard_pro extension loaded.
[I 2022-09-19 20:59:08.448 SingleUserLabApp manager:362] jupyterlab_tensorboard_pro | extension was successfully loaded.

可能后面还需要你有空看看有没有这两行输出,以及如果没有的话是不是有报错输出

STHSF commented

我这边也复现了一遍,重新创建了一个虚拟环境,在新的环境下确实没有问题。可能是原来的环境问题,感谢🙏🙏

这个问题暂时没有更新,应该已经解决,先关闭了,后面大家有问题可以继续提问~