概要描述
Sophon notebook页面输出大量信息时(如print()或plt.show()等)时报错:IOPub data rate exceeded。此时,需要在报错的notebook所使用的镜像中的/bin/notebook.sh文件中添加配置参数:
–NotebookApp.iopub_data_rate_limit=1e10。
详细说明
在notebook实例zyq_dl中print(lines)报错详细信息如下:
IOPub data rate exceeded.
The notebook server will temporarily stop sending output
to the client in order to avoid crashing it.
To change this limit, set the config variable
--NotebookApp.iopub_data_rate_limit
.
Current values:
NotebookApp.iopub_data_rate_limit=1000000.0 (bytes/sec)
NotebookApp.rate_limit_window=3.0 (secs)
主要是默认输出io速率阈值NotebookApp.iopub_data_rate_limit太低(约1M/s),可以加大改参数至1e10(提高一万倍,即约10G/s)。
修改参数步骤如下:
-
找到该notebook实例后台对应的pod,可参考KB:判断Sophon notebook页面对应后台notebook pod的方式。
-
找到该notebook实例使用的镜像,可以通过页面查看,或后台方式查看,参考KB:TDH查看当前服务运行使用的镜像,注意需要describe该notebook的pod。
3.在该notebook pod所在节点(示例中为tdh-01节点),查看notebook的docker镜像(示例中为sophon-notebook cpu版深度学习镜像sophon-notebook-deeplearning-cpu)。
4.docker tag备份原镜像
docker tag 99545c352ff2 tdh-01:5000/transwarp/sophon-notebook-deeplearning-cpu:sophon-2.6.2-final_ori
5.docker run启动一个notebook docker容器,注意这个容器id,下面docker commit会用到。
6.在容器内修改/bin/notebook.sh。
–NotebookApp.iopub_data_rate_limit=1e10
7.docker commit生成新的镜像
docker commit 56b0c09db1fd tdh-01:5000/transwarp/sophon-notebook-deeplearning-cpu:sophon-2.6.2-final
8.docker push到docker registry
docker push tdh-01:5000/transwarp/sophon-notebook-deeplearning-cpu:sophon-2.6.2-final
9.页面先停止,然后打开notebook,这样就会使用修改了启动参数的镜像来启动notebook实例(即后台的notebook pod)
10.可以愉快地print了