C4 W4 A2: Kernel dies in provided code

i am trying to complete Course 4, Week 4 “Programming Assignment: Art Generation with Neural Style Transfer” and i get “The kernel appears to have died. It will restart automatically.” when calling “vgg_model_outputs” in the cells that are provided for us. This is really frustrating!

Hi @Daniel_Braun,

Kernel dying means your implementation is not right somewhere. Make your way back from egg_model_outputs to see what needs to be fixed.


There is another parallel thread about this. It looks like Daniel’s problem has just magically cleared up. The only theory I can come up with is “bad weather in the cloud”. :sweat_smile:


I’m having the same problem in the U-Net assignment of week 3. I can’t train the model because the kernel dies always after processing few batches. Submitting worked fine but I can’t see the output of my code :smiley: Shall I wait until the bad weather is gone?

1 Like

Yes, you should wait until bad weather gone :joy::rofl::grin::grinning:. But grader passed you or not?


Can you provide a screen capture image that shows this? I am curious what “the kernel dies” looks like in your browser.

Yes the grader passed. But I couldn’t test my code till now. Now, I’m getting the same error while trying to compute the output of the VGG model in the assginment of NST (week 4) after running the following code:

content_target = vgg_model_outputs(content_image)  # Content encoder
style_targets = vgg_model_outputs(style_image)     # Style encoder

It looks like this

Have you added any print statements in the inner loops that are causing the output to be more voluminous than necessary?


No print statements were added to the code.


Some days ago, we were facing that issue too. But now I ran all the cells of this assignment, Art_Generation_with_Neural_Style_Transfer, and it works perfectly. If your code is error-free, give it a try and update us.


i am facing similar issue

Hello @azhar_abbasi !

I’ve replied to your post here.