0
  !wget https://github.com/lazyprogrammer/machine_learning_examples/blob/master/cnn_class/lena.png
  from PIL import Image 
  im =Image.open('lena.png')

UnidentifiedImageError Traceback (most recent call last) in () ----> 1 im =Image.open('lena.png')

/usr/local/lib/python3.6/dist-packages/PIL/Image.py in open(fp, mode) 2929 warnings.warn(message) 2930 raise UnidentifiedImageError( -> 2931 "cannot identify image file %r" % (filename if filename else fp) 2932 ) 2933

UnidentifiedImageError: cannot identify image file 'lena.png'

1
  • 1
    I presume the ! allows you to run shell commands, if so, check if Lena is there before you open the file with !ls -l lena.png Jul 11, 2020 at 10:31

1 Answer 1

1

The link you are using to wget is all wrong. You are actually sending a GET request to the html file instead of the image. Here's the actual image link for you :)

https://raw.githubusercontent.com/lazyprogrammer/machine_learning_examples/master/cnn_class/lena.png

1
  • ya u r right but why it would not be open from link that i use....@abjklk Jul 19, 2020 at 9:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.