1
0

Gemini pro visionで画像読み込もうとしてエラーTypeError: Could not create `Blob`, expected `Blob`, `dict` or an `Image` type(`PIL.Image.Image` or `IPython.display.Image`).

Posted at

問題

Gemini Pro Visionで画像を読み込もうとしたら
下記エラーが表示された

TypeError: Could not create `Blob`, expected `Blob`, `dict` or an `Image` type(`PIL.Image.Image` or `IPython.display.Image`).

解決方法

from IPython.display import Image
img = Image(image_path)

原因というかもともとのコード

img = PIL.Image.open(image_path)
img

メモ

PILで画像を読み込んでいた
PILというかpillowというかよくわかってない顔

IPython.display を利用するとうまく読み込めた

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0