python - Colab 以 ^C 结束

标签 python google-colaboratory

我正在 Colab 上运行一个拉普拉斯金字塔程序,该程序未矢量化,因此需要时间,当它到达 def vizpyramid() 时,它就会按以下方式退出:

100% 1/1 [00:00<00:00, 23.74it/s]
def computestack
len grayimgs 2
gray_imgs[0] shape (500, 333)
len lapylpyrcolor 3, len lapylpyrcolor[0] 5
len lapylpyrcolor 3, len lapylpyrcolor[0] 5
fusedgray shape (500, 333)
def vizpyramid
^C

其中大部分来自 print 语句,除了 100%...^C 之外。我没有按下 control-C 那么发生了什么?我检查了该功能,它在我的本地计算机上运行良好。

编辑:我尝试切换到 None 无 GPU 运行时,现在它甚至无法使用 !python main.py 命令运行。

最佳答案

我在colab中运行python时遇到了同样的问题。我发现因为我生成的列表太大了,应该已经占满了所有的内存。

关于python - Colab 以 ^C 结束,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58889498/

相关文章:

python - 无法在 Google Colab 中加载 OpenAI Gym 环境

python - 在字典的 for 循环中解压多个变量

python - LPTHW : double quotes around CSV. 作家

python - 将对象添加到 session 时,SQLAlchemy 是否保存顺序?

python - 是否可以调用需要参数的函数,而无需该参数?在python上

python - 如何为 Google Colaboratory 安装 cx_oracle python 模块

python - 在 Python 中将多个变量值分配给单个变量

python-3.x - tensorflow 概率: AttributeError: module 'tensorflow_probability.* has no attribute ' *'

python - Google colab 中的时态数据存储在哪里?

google-colaboratory - 事件 session 数Google Colab Pro