printing - 为什么 Google colaboratory 停止打印?
问题描述
from PIL import Image
for i in range(1,15):
im = Image.open('star%d.png'%i)
black = []
black_pixels=0
for pixel in im.getdata():
if pixel == (0, 0, 0):
black_pixels += 1
black.append(black_pixels)
print(black_pixels)
print(black)
我想检查 14 张图像的黑色像素数,但 Google colab 打印如下:
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)
无论图像数量如何,Google colab 在计算最后一张图像的像素时总是这样打印
我怎么解决这个问题?(对不起我的英语水平低)
解决方案
推荐阅读
- javascript - 如何解决 - 每次都没有给出正确答案
- rust - 有没有办法在非夜间 Rust 上查看扩展宏?
- c++ - 在一个 QTableWidget 单元格中显示不同颜色的字符串
- reactjs - 使用 typesafe-actions 的 createAsyncAction 时缩小 TypeScript 动作类型
- r - grepl 不适用于 devtools::load_all()
- java - Spring boot 2.0.3 thymeleaf Error Rendering some pages
- java - Guava ImmutableMap 中带有 getProperty() 方法的 ExceptionInInitializerError
- c# - 如何使用索引视图内的一个循环构建两个标签
我正在构建两个会议列表,右侧 div (8 col) 假设包含所有会议,而左侧 div (4 col) 假设仅包含特色会议。我已经使用两个循环执行了它,它会影响性能。我的问题是如何使用一个 foreach 循环遍历两个 div?
<table class="table-hover table table-striped table-bordered dt-responsive"> <
- git - 何时创建新的 git 分支与提交更新
- c++ - perf 如何采样内核堆栈?