【问题标题】:Fine Tuning Stable Diffusion微调稳定扩散
【发布时间】:2022-11-11 15:51:14
【问题描述】:

我正在尝试使用微调方法来稳定扩散以生成 AI 艺术,如果需要,请访问 google colab 链接https://colab.research.google.com/drive/1yGiI2TYkFMuETm4Rh5bh3-k6yY1C38w0?usp=sharing#scrollTo=60jVYSk0BGC8&uniqifier=3

   #@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))

返回错误

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

【问题讨论】:

  • image 是什么?
  • 我不确定,我正在关注笔记本,检查第一个链接

标签: python performance


【解决方案1】:

它来自 PIL 并确保使用 Image 导入该函数。

from PIL import Image

【讨论】:

    猜你喜欢
    • 2022-11-14
    • 2022-12-31
    • 2022-11-18
    • 2022-11-03
    • 2022-12-19
    • 2022-10-01
    • 2023-02-22
    • 2022-11-11
    • 2023-02-23
    相关资源
    最近更新 更多