Skip to content
Advertisement

AWS SageMaker Jupyter Notebook: Images not Showing

I’m currently trying to display some images using AWS SageMaker making use of its Jupyter Notebook app. However, all I’m trying to do is show the loaded images. I have written a function to do this but all I’m left with is the images index and image name on calling the function.

The function:

JavaScript

Calling the function:

JavaScript

Example result:

JavaScript

I’ve done various things from logging out/in to restarting the kernel; only one option and thats python 3.

Advertisement

Answer

You have to add line to the first cell (or before the first plt.show() call) of the notebook:

JavaScript

This a is a magic function in IPython.

According to documentation:

With this backend, the output of plotting commands is displayed inline within frontends like the Jupyter notebook, directly below the code cell that produced it. The resulting plots will then also be stored in the notebook document.

Advertisement