小编pch*_*pch的帖子

散景:在 jupyter 实验室中重复绘图会增加(浏览器)内存使用量

我使用背景虚化绘制许多时间序列(> 100)与内多点(〜20,000)Jupyter实验室笔记本。当执行小区多次在Jupyter的存储器的消耗铬超过400MB每次运行的增加。在多次单元执行后,Chrome 往往会崩溃,通常是在累积了几 GB 的 RAM 使用量时。此外,每次执行后绘图往往会变慢。

Jupyter 中的“清除 [所有] 输出”“重新启动内核并清除所有输出...”也不会释放任何内存。在经典的Jupyter Notebook以及FirefoxEdge 中,也会出现此问题。

我的 .ipynp 的最小版本:

import numpy as np
from bokeh.io import show, output_notebook
from bokeh.plotting import figure
import bokeh
output_notebook() # See e.g.: https://github.com/bokeh/bokeh-notebooks/blob/master/tutorial/01%20-%20Basic%20Plotting.ipynb
Run Code Online (Sandbox Code Playgroud)
# Just create a list of numpy arrays with random-walks as dataset
ts_length = 20000
n_lines = 100
np.random.seed(0)
dataset = [np.cumsum(np.random.randn(ts_length)) …
Run Code Online (Sandbox Code Playgroud)

python bokeh jupyter jupyter-notebook jupyter-lab

7
推荐指数
1
解决办法
1003
查看次数

标签 统计

bokeh ×1

jupyter ×1

jupyter-lab ×1

jupyter-notebook ×1

python ×1