I'm running TensorFlow's Image captioning with visual attention tutorial in Google Colab (https://www.tensorflow.org/tutorials/text/image_captioning).
I would like to caption my own images with the trained model. As a test, I wanted to see the results of a random wikipedia image of a cat. However, I got the errors that I paste under this message. It wants my inputs to be " already EagerTensors".
If I have, say, 10 images locally on my laptop that would want to caption - how should I proceed? Warm thanks for any advice - I am a beginner so these kind of forums are important!
#image_url = 'https://en.wikipedia.org/wiki/Kitten#/media/File:KITTEN_on_BAMBOO_top_C_11JUN94.jpg'
#image_extension = image_url[-4:]
#image_path = tf.keras.utils.get_file('image'+image_extension,
#origin=image_url)
image_path = 'https://en.wikipedia.org/wiki/Kitten#/media/File:KITTEN_on_BAMBOO_top_C_11JUN94.jpg'
result, attention_plot = evaluate(image_path)
print ('Prediction Caption:', ' '.join(result))
plot_attention(image_path, result, attention_plot)
# opening the image
Image.open(image_path)
_FallbackException Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/tensorflow/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
_FallbackException: This function does not handle the case of the path where all inputs are not already EagerTensors.
During handling of the above exception, another exception occurred:
UnimplementedError Traceback (most recent call last)
5 frames
/usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/execute.py in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name)
58 ctx.ensure_initialized()
59 tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
---> 60 inputs, attrs, num_outputs)
61 except core._NotOkStatusException as e:
62 if name is not None:
UnimplementedError: File system scheme 'https' not implemented (file: 'https://en.wikipedia.org/wiki/Kitten#/media/File:KITTEN_on_BAMBOO_top_C_11JUN94.jpg') [Op:ReadFile]