简体   繁体   English

Jupyter Kernel 运行时死亡 TensorFlow Model

[英]Jupyter Kernel Dies when Running TensorFlow Model

While training a TensorFlow Model in Jupyter, the kernel dies before the first epoch.在 Jupyter 中训练 TensorFlow Model 时,kernel 在第一个纪元之前死亡。

The model I am using is a DeepLab with input size 256 on a ResNet50 encoder.我使用的 model 是在 ResNet50 编码器上输入大小为 256 的 DeepLab。 I cannot show the model summary because it is too long to fit in the question.我无法显示 model 摘要,因为它太长而无法放入问题中。 This issue only happens with this specific model and does not occur with others that I have used.此问题仅发生在这个特定的 model 上,而不会发生在我使用的其他人身上。

Here is the output of the cell when I try to train the model:这是我尝试训练 model 时单元格的 output:

Epoch 1/100
2023-01-07 12:22:01.752760: W tensorflow/tsl/platform/profile_utils/cpu_utils.cc:128] Failed to get CPU frequency: 0 Hz
2023-01-07 12:22:05.727903: I tensorflow/core/grappler/optimizers/custom_graph_optimizer_registry.cc:114] Plugin optimizer for device_type GPU is enabled.
The Kernel crashed while executing code in the the current cell or a previous cell. Please review the code in the cell(s) to identify a possible cause of the failure. Click here for more info. View Jupyter log for further details.
Canceled future for execute_request message before replies were done

This issue occurs in both VSCode Jupyter and Jupyter Notebook/Lab. VSCode Jupyter 和 Jupyter Notebook/Lab 中都会出现此问题。

I have tried restarting the kernel, reinstalling tensorflow, creating a new environment, and using the nomkl library.我试过重新启动 kernel,重新安装 tensorflow,创建一个新环境,并使用nomkl库。 I am on an M1 MacBook Pro running Tensorflow 2.11.0 (macos).我在运行 Tensorflow 2.11.0 (macos) 的 M1 MacBook Pro 上。 The python version is 3.10. python 版本为 3.10。

Problem solved by running in Colab.通过在 Colab 中运行解决了问题。 I just downloaded the weights and log files from there.我刚刚从那里下载了权重和日志文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM