Im trying this code to open an image in a jupyter notebook with python.
This is the code:
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
# Read Images
img = mpimg.imread('C:/Users/alvar/Desktop/IE/1 - Full-time/Term 2/Machine Learning 2/Assigments/Group/For sunday/Tanzania.png')
# Output Images
plt.imshow(img)
And is giving me this error:
ValueError Traceback (most recent call last) in 3 4 # Read Images ----> 5 img = mpimg.imread('C:/Users/alvar/Desktop/IE/1 - Full-time/Term 2/Machine Learning 2/Assigments/Group/For sunday/Tanzania.png') 6 7 # Output Images
~\Anaconda3\lib\site-packages\matplotlib\image.py in imread(fname, format) 1373 else: 1374 with open(fname, 'rb') as fd: -> 1375 return handler(fd) 1376 else: 1377 return handler(fname)
ValueError: invalid PNG header