Attribute Error: openai has no attribute Image
Question:
So I was getting my hands-on on the new DALL.E api for Python which has been made public. I was getting the Attribution Error as it was not detecting the Image model in Open ai after running the following code:
response = openai.Image.create(
prompt="a white siamese cat",
n=1,
size="1024x1024"
)
image_url = response['data'][0]['url']
Why am I getting this error?
Answers:
I just found the solution. You have to upgrade your openai library with code:
pip install --upgrade openai
Restart the kernel, and enjoy 🙂
Had the same problem. I noticed my python is 3.7.0, which only supports up to openai=0.8… for openai 0.25.0, will need at least python>=3.7.1
So I was getting my hands-on on the new DALL.E api for Python which has been made public. I was getting the Attribution Error as it was not detecting the Image model in Open ai after running the following code:
response = openai.Image.create(
prompt="a white siamese cat",
n=1,
size="1024x1024"
)
image_url = response['data'][0]['url']
Why am I getting this error?
I just found the solution. You have to upgrade your openai library with code:
pip install --upgrade openai
Restart the kernel, and enjoy 🙂
Had the same problem. I noticed my python is 3.7.0, which only supports up to openai=0.8… for openai 0.25.0, will need at least python>=3.7.1