首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >微调稳定扩散

微调稳定扩散
EN

Stack Overflow用户
提问于 2022-10-01 07:08:12
回答 1查看 762关注 0票数 1

我正在尝试使用微调方法来稳定扩散以生成AI,如果需要的话,这是google链接

代码语言:javascript
复制
   #@title Setup and check the images you have just added
import requests
import glob
from io import BytesIO

def download_image(url):
  try:
    response = requests.get(url)
  except:
    return None
  return image.open(BytesIO(response.content)).convert("RGB")

images = list(filter(None,[download_image(url) for url in urls]))
save_path = "./my_concept"
if not os.path.exists(save_path):
  os.mkdir(save_path)
[image.save(f"{save_path}/{i}.jpeg") for i, image in enumerate(images)]
image_grid(images, 1, len(images))

返回错误

代码语言:javascript
复制
NameError                                 Traceback (most recent call last)
<ipython-input-49-adadff211ef8> in <module>
     11   return image.open(BytesIO(response.content)).convert("RGB")
     12 
---> 13 images = list(filter(None,[download_image(url) for url in urls]))
     14 save_path = "./my_concept"
     15 if not os.path.exists(save_path):

1 frames
<ipython-input-49-adadff211ef8> in download_image(url)
      9   except:
     10     return None
---> 11   return image.open(BytesIO(response.content)).convert("RGB")
     12 
     13 images = list(filter(None,[download_image(url) for url in urls]))

NameError: name 'image' is not defined
EN

回答 1

Stack Overflow用户

发布于 2022-10-25 22:40:13

它来自PIL,并确保函数是用\Image导入的。

代码语言:javascript
复制
from PIL import Image
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73916442

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档