title: ValueError: Attempt to convert a value (<PIL.PngImagePlugin.PngImageFile image mode=RGB size=519x600 at 0x7F95AD916518>) with an unsupported type
body: <p>while i was opening and decoding an image from python with tensorflow  i got an error</p>
  
  <pre><code>%tensorflow_version 2.x
  import tensorflow as tf
  from PIL import Image
  import requests
  from io import BytesIO
  response = requests.get(r'https://upload.wikimedia.org/wikipedia/commons/e/e9/Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png')
  img = Image.open(BytesIO(response.content))
  
  tf_image = tf.io.read_file(img)
  </code></pre>
  
  <p>error is hapenning when i used <code>tf.io.read_file(img)</code> 
  Throws error of </p>
  
  <blockquote>
    <blockquote>
      <hr>
      
      <p>_FallbackException                        Traceback (most recent call last)
      /tensorflow-2.1.0/python3.6/tensorflow_core/python/ops/gen_io_ops.py
      in read_file(filename, name)
          548         _ctx._context_handle, tld.device_name, "ReadFile", name,
      --> 549         tld.op_callbacks, filename)
          550       return _result</p>
    </blockquote>
    
    <p>_FallbackException: This function does not handle the case of the path where all inputs are not already EagerTensors.</p>
    
    <p>During handling of the above exception, another exception occurred:</p>
    
    <p>ValueError                                Traceback (most recent call
    last) 7 frames
    /tensorflow-2.1.0/python3.6/tensorflow_core/python/framework/constant_op.py
    in convert_to_eager_tensor(value, ctx, dtype)
         94       dtype = dtypes.as_dtype(dtype).as_datatype_enum
         95   ctx.ensure_initialized()
    ---> 96   return ops.EagerTensor(value, ctx.device_name, dtype)
         97 
         98 </p>
    
    <p>ValueError: Attempt to convert a value
    () with an unsupported type () to a Tensor.</p>
  </blockquote>