stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Bug]: interrogate CLIP crash in FileExistsError

Open LieDeath opened this issue 2 years ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What happened?

When I clicked interrogate CLIP button in i2i page with a photo on, It crashed with this error FileExistsError. However the prompts have given out, only without the artist. I suspect that the problem is caused by a historical merge which removed the artists.csv.

Steps to reproduce the problem

  1. Go to i2i page and drop down a photo
  2. Press the interrogate CLIP
  3. prompts have produced, only without the artist
  4. the command line show up a FileExistsError

What should have happened?

I can get the dmn uncorrect artist without any error or any stuid sign tell me that the file is exist! I reinstalled the CLIP for a quarter hour only back me the same error!

Commit where the problem happens

48a15821de768fea76e66f26df83df3fddf18f4b

What platforms do you use to access UI ?

Windows

What browsers do you use to access the UI ?

Microsoft Edge

Command Line Arguments

Before reinstall the CLIP

load checkpoint from D:\AI6\stable-diffusion-webui\models\BLIP\model_base_caption_capfilt_large.pth
Downloading CLIP categories...
downloading default CLIP interrogate categories: FileExistsError
Traceback (most recent call last):
  File "D:\AI6\stable-diffusion-webui\modules\interrogate.py", line 35, in download_default_clip_interrogate_categories
    os.makedirs(tmpdir)
  File "C:\Users\Miku\AppData\Local\Programs\Python\Python310\lib\os.py", line 225, in makedirs
    mkdir(name, mode)
FileExistsError: [WinError 183] 当文件已存在时,无法创建该文件。: 'interrogate_tmp'

Error interrogating
Traceback (most recent call last):
  File "D:\AI6\stable-diffusion-webui\modules\interrogate.py", line 211, in interrogate
    for name, topn, items in self.categories():
  File "D:\AI6\stable-diffusion-webui\modules\interrogate.py", line 62, in categories
    download_default_clip_interrogate_categories(self.content_dir)
  File "D:\AI6\stable-diffusion-webui\modules\interrogate.py", line 44, in download_default_clip_interrogate_categories
    os.remove(tmpdir)
PermissionError: [WinError 5] 拒绝访问。: 'interrogate_tmp'


After reinstall the CLIP

Downloading: "https://storage.googleapis.com/sfr-vision-language-research/BLIP/models/model_base_caption_capfilt_large.pth" to D:\AI6\stable-diffusion-webui\models\BLIP\model_base_caption_capfilt_large.pth

100%|███████████████████████████████████████████████████████████████████████████████| 855M/855M [00:52<00:00, 17.1MB/s]
load checkpoint from D:\AI6\stable-diffusion-webui\models\BLIP\model_base_caption_capfilt_large.pth
Downloading CLIP categories...
downloading default CLIP interrogate categories: FileExistsError
Traceback (most recent call last):
  File "D:\AI6\stable-diffusion-webui\modules\interrogate.py", line 35, in download_default_clip_interrogate_categories
    os.makedirs(tmpdir)
  File "C:\Users\Miku\AppData\Local\Programs\Python\Python310\lib\os.py", line 225, in makedirs
    mkdir(name, mode)
FileExistsError: [WinError 183] 当文件已存在时,无法创建该文件。: 'interrogate_tmp'

Error interrogating
Traceback (most recent call last):
  File "D:\AI6\stable-diffusion-webui\modules\interrogate.py", line 211, in interrogate
    for name, topn, items in self.categories():
  File "D:\AI6\stable-diffusion-webui\modules\interrogate.py", line 62, in categories
    download_default_clip_interrogate_categories(self.content_dir)
  File "D:\AI6\stable-diffusion-webui\modules\interrogate.py", line 44, in download_default_clip_interrogate_categories
    os.remove(tmpdir)
PermissionError: [WinError 5] 拒绝访问。: 'interrogate_tmp'

Additional information, context and logs

Is it OK? I don't know why when I got a screenshot it just became dark mode. However, I have highlighted the <error> in the text box. 网页捕获_25-1-2023_20386_127 0 0 1

LieDeath avatar Jan 25 '23 12:01 LieDeath

I am getting exactly same error too with new update

tarunabhdutta avatar Jan 26 '23 19:01 tarunabhdutta

same issue

cheezecrisp avatar Jan 31 '23 08:01 cheezecrisp

Exactly the same Error! Please Fix

LiJT avatar Feb 01 '23 05:02 LiJT

`Loading weights [cc6cb27103] from E:\stable-diffusion\models\Stable-diffusion\SD1.5_pruned-emaonly.ckpt Creating model from config: E:\stable-diffusion\configs\v1-inference.yaml LatentDiffusion: Running in eps-prediction mode DiffusionWrapper has 859.52 M params. Applying xformers cross attention optimization. Model loaded in 1.7s (create model: 0.3s, apply weights to model: 0.6s, apply half(): 0.3s, move model to device: 0.5s). Downloading CLIP categories... downloading default CLIP interrogate categories: FileExistsError Traceback (most recent call last): File "E:\stable-diffusion\modules\interrogate.py", line 35, in download_default_clip_interrogate_categories os.makedirs(tmpdir) File "C:\Users\charl\AppData\Local\Programs\Python\Python310\lib\os.py", line 225, in makedirs mkdir(name, mode) FileExistsError: [WinError 183] 当文件已存在时,无法创建该文件。: 'interrogate_tmp'

Error interrogating Traceback (most recent call last): File "E:\stable-diffusion\modules\interrogate.py", line 211, in interrogate for name, topn, items in self.categories(): File "E:\stable-diffusion\modules\interrogate.py", line 62, in categories download_default_clip_interrogate_categories(self.content_dir) File "E:\stable-diffusion\modules\interrogate.py", line 44, in download_default_clip_interrogate_categories os.remove(tmpdir) PermissionError: [WinError 5] 拒绝访问。: 'interrogate_tmp' `

LiJT avatar Feb 01 '23 05:02 LiJT

okay I found the solution. In your root directory of web-ui there should be a folder named "interrogate_tmp". Delete it and then try Interrogate CLIP again, it will start Downloading CLIP categories....

if it fails and says, "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond",

it means you live in a country like India (mine) where govt. has unnecessarily banned urls like raw.githubusercontent.com, why??? God knows

then you need to connect to a VPN and repeat the process I told (delete the folder again if it appears again),

remember, after connecting VPN, the IP changes so instead use "http://localhost:{portnumber}/"

edit: here is easier way if you don't have VPN and if it still doesn't work,

here download this file : interrogate.7z

and put the folder named "interrogate" in you root web-ui directory and remember to delete the "interrogate_tmp" folder

the 4 files should look like,

"root-folder"\interrogate\artists.txt "root-folder"\interrogate\flavors.txt "root-folder"\interrogate\mediums.txt "root-folder"\interrogate\movements.txt

extra2AB avatar Feb 16 '23 21:02 extra2AB

okay I found the solution. In your root directory of web-ui there should be a folder named "interrogate_tmp". Delete it and then try Interrogate CLIP again, it will start Downloading CLIP categories....

if it fails and says, "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond",

it means you live in a country like India (mine) where govt. has unnecessarily banned urls like raw.githubusercontent.com, why??? God knows

then you need to connect to a VPN and repeat the process I told (delete the folder again if it appears again),

remember, after connecting VPN, the IP changes so instead use "http://localhost:{portnumber}/"

edit: here is easier way if you don't have VPN and if it still doesn't work,

here download this file : interrogate.7z

and put the folder named "interrogate" in you root web-ui directory and remember to delete the "interrogate_tmp" folder

the 4 files should look like,

"root-folder"\interrogate\artists.txt "root-folder"\interrogate\flavors.txt "root-folder"\interrogate\mediums.txt "root-folder"\interrogate\movements.txt

Big thanks! It worked for me!

LieDeath avatar Feb 17 '23 03:02 LieDeath

好的,我找到了解决方案。在web-ui的根目录中,应该有一个名为“interrogate_tmp”的文件夹。删除它,然后再次尝试询问剪辑,它将开始下载剪辑类别.... 如果失败并说“连接尝试失败,因为连接方在一段时间后未正确响应,或者建立的连接失败,因为连接的主机无法响应”, 这意味着你生活在像印度(我的)这样的国家,政府不必要地禁止了像 raw.githubusercontent.com 这样的网址,为什么???天知道 然后您需要连接到VPN并重复我告诉的过程(如果再次出现,请再次删除该文件夹), 请记住,连接VPN后,IP会发生变化,因此请使用“http://localhost:{端口号}/" 编辑:如果您没有VPN,如果仍然无法正常工作,这是更简单的方法, 在这里下载这个文件:审讯.7z 并将名为“询问”的文件夹放在您的根 web-ui 目录中,并记得删除“interrogate_tmp”文件夹 这 4 个文件应如下所示: “根文件夹”\询问\艺术家.txt“根文件夹”\询问\风格.txt“根文件夹”\询问\媒介.txt“根文件夹”\询问\运动.txt

非常感谢!它对我有用!

兄弟 我把这个文件夹考进去以后怎么还是不好使啊,有别的解决方案么

AlexANSO avatar Mar 01 '23 10:03 AlexANSO

好的,我找到了解决方案。在web-ui的根目录中,应该有一个名为“interrogate_tmp”的文件夹。删除它,然后再次尝试询问剪辑,它将开始下载剪辑类别.... 如果失败并说“连接尝试失败,因为连接方在一段时间后未正确响应,或者建立的连接失败,因为连接的主机无法响应”, 这意味着你生活在像印度(我的)这样的国家,政府不必要地禁止了像 raw.githubusercontent.com 这样的网址,为什么???天知道 然后您需要连接到VPN并重复我告诉的过程(如果再次出现,请再次删除该文件夹), 请记住,连接VPN后,IP会发生变化,因此请使用“http://localhost:{端口号}/" 编辑:如果您没有VPN,如果仍然无法正常工作,这是更简单的方法, 在这里下载这个文件:审讯.7z 并将名为“询问”的文件夹放在您的根 web-ui 目录中,并记得删除“interrogate_tmp”文件夹 这 4 个文件应如下所示: “根文件夹”\询问\艺术家.txt“根文件夹”\询问\风格.txt“根文件夹”\询问\媒介.txt“根文件夹”\询问\运动.txt

非常感谢!它对我有用!

兄弟 我把这个文件夹考进去以后怎么还是不好使啊,有别的解决方案么

这个方案在我电脑上的确能用。你可能缺少了open clip的某些组件。

LieDeath avatar Mar 01 '23 10:03 LieDeath

okay I found the solution. In your root directory of web-ui there should be a folder named "interrogate_tmp". Delete it and then try Interrogate CLIP again, it will start Downloading CLIP categories....

if it fails and says, "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond",

it means you live in a country like India (mine) where govt. has unnecessarily banned urls like raw.githubusercontent.com, why??? God knows

then you need to connect to a VPN and repeat the process I told (delete the folder again if it appears again),

remember, after connecting VPN, the IP changes so instead use "http://localhost:{portnumber}/"

edit: here is easier way if you don't have VPN and if it still doesn't work,

here download this file : interrogate.7z

and put the folder named "interrogate" in you root web-ui directory and remember to delete the "interrogate_tmp" folder

the 4 files should look like,

"root-folder"\interrogate\artists.txt "root-folder"\interrogate\flavors.txt "root-folder"\interrogate\mediums.txt "root-folder"\interrogate\movements.txt

thanks,it's useful for me!

naisev avatar Mar 06 '23 13:03 naisev

好的,我找到了解决方案。在web-ui的根目录中,应该有一个名为“interrogate_tmp”的文件夹。删除它,然后再次尝试询问剪辑,它将开始下载剪辑类别.... 如果失败并说“连接尝试失败,因为连接方在一段时间后未正确响应,或者建立的连接失败,因为连接的主机无法响应”, 这意味着你生活在像印度(我的)这样的国家,政府不必要地禁止了像 raw.githubusercontent.com 这样的网址,为什么???天知道 然后您需要连接到VPN并重复我告诉的过程(如果再次出现,请再次删除该文件夹), 请记住,连接VPN后,IP会发生变化,因此请使用“http://localhost:{端口号}/" 编辑:如果您没有VPN,如果仍然无法正常工作,这是更简单的方法, 在这里下载这个文件:审讯.7z 并将名为“询问”的文件夹放在您的根 web-ui 目录中,并记得删除“interrogate_tmp”文件夹 这 4 个文件应如下所示: “根文件夹”\询问\艺术家.txt“根文件夹”\询问\风格.txt“根文件夹”\询问\媒介.txt“根文件夹”\询问\运动.txt

非常感谢!它对我有用!

兄弟 我把这个文件夹考进去以后怎么还是不好使啊,有别的解决方案么

并记得删除“interrogate_tmp”文件夹,你是不是没有删除。我用了这个方法,也正常了。

hiquan avatar Apr 11 '23 16:04 hiquan

好吧,我找到了解决方案。 在您的 web-ui 根目录中应该有一个名为“interrogate_tmp”的文件夹。 删除它,然后再次尝试询问 CLIP,它将开始下载 CLIP 类别....

如果失败并显示: “连接尝试失败,因为连接方在一段时间后没有正确响应,或者建立的连接失败,因为连接的主机未能响应”,

这意味着你生活在像印度(我的)这样的国家,那里的政府。不必要地禁止了像 raw.githubusercontent.com 这样的网址,为什么???天知道

然后你需要连接到VPN并重复我告诉的过程(如果再次出现,请再次删除该文件夹),

请记住,连接 VPN 后,IP 会发生变化,因此请使用“http://localhost:{portnumber}/”< /span>

编辑:如果您没有 VPN 并且它仍然不起作用,这是更简单的方法,

在此下载此文件:interrogate.7z

并将名为“interrogate”的文件夹放入在你的 web-ui 根目录中,记住删除“interrogate_tmp”文件夹

这 4 个文件应该是这样的,

“根文件夹”\interrogate\artists.txt “根文件夹”\interrogate\flavors.txt “根文件夹”\interrogate\mediums.txt “根文件夹”\interrogate\movements.txt

不一定都在webui的根目录下,我的情况是将interrogate放在webui目录下无效,但是放在系统根目录有用,如果放在webui目录下无效,建议find / -name interrogate_tmp搜索一下临时文件目录下载哪里的,放在这个文件夹同级目录,或者编辑./modules/interrogate.py,在__init__函数中打印content_dir目录,放在指定位置

mjwyr avatar Dec 20 '23 05:12 mjwyr

报错信息:urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: EE certificate key too weak (_ssl.c:997)> 原因:证书认证问题。 解决方案: 你需要在./modules/interrogate.py中加入如下两行代码,取消全局证书认证 import ssl ssl._create_default_https_context = ssl._create_unverified_context

stefan252423 avatar Jan 17 '24 08:01 stefan252423

image

hd7133989 avatar May 16 '24 11:05 hd7133989