You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, may I ask if I have downloaded the pre-training model you sent to the local, changed the path in the code, or this problem, may I ask what is going on? thank you
I didn't encounter such an issue before, but maybe you can have a look at this issue huggingface/transformers#17611 which is quite similar.
Besides, there could also sometimes be internet problem. You can also have a try to add this script at the start of the code (refer to CompVis/stable-diffusion#302 (comment)):
If you want to load the pre-trained model from the local machine, you may need to ensure downloading the correct type of files. Below is the needed file list of Stable Diffusion:
Thanks for your reply, can you give me a link to the pre-training model of this project? Maybe my pre-training model is not in the right file. thank you
I downloaded the pre-training model to the local, there is this problem, hope you can help to answer it, thank you Attack based on Diffusion***
Traceback (most recent call last):
File "main.py", line 114, in
ldm_stable = StableDiffusionPipeline.from_pretrained(pretrained_diffusion_path).to('cuda:0')
File "F:\Anaconda2023\anaconda3\envs\diffattack\lib\site-packages\diffusers\pipelines\pipeline_utils.py", line 1037, in from_pretrained
loaded_sub_model = load_sub_model(
File "F:\Anaconda2023\anaconda3\envs\diffattack\lib\site-packages\diffusers\pipelines\pipeline_utils.py", line 450, in load_sub_model
loaded_sub_model = load_method(os.path.join(cached_folder, name), **loading_kwargs)
File "F:\Anaconda2023\anaconda3\envs\diffattack\lib\site-packages\transformers\tokenization_utils_base.py", line 2094, in from_pretrained
raise EnvironmentError(
OSError: Can't load tokenizer for 'stabilityai/stable-diffusion-2-base\tokenizer'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'stabilityai/stable-diffusion-2-base\tokenizer' is the correct path to a directory containing all relevant files for a CLIPTokenizer tokenizer.
Could you please let me know the level of file path you passed into the code?
For example, here's my local save path:
And it should work when setting the --pretrained_diffusion_path="C:\Users\PC\.cache\huggingface\diffusers\models--stabilityai--stable-diffusion-2-base\snapshots\455a0f46082..." in the main.py.
This is the previous version you published, but it does not affect. I put the pre-trained model downloaded from the link you sent above into the project, and I also loaded it directly in the code. As shown in the figure. I see you put it under the C drive path, is that the reason? In addition, the pre-trained model I downloaded does not have huggingface\diffusers\ in front, is this affecting the operation? thank you
I apologize for the confusion regarding the path specified in the code: --pretrained_diffusion_path="stabilityai/stable-diffusion-2-base". The value stabilityai/stable-diffusion-2-base does not refer to a local path. Instead, it points to the Hugging Face repository stabilityai/stable-diffusion-2-base from which the necessary weights will be downloaded automatically.
The error message you encountered previously might be due to a name collision if you have a local directory with the same name as the Hugging Face repository. To resolve this, please try using an absolute path for the --pretrained_diffusion_path parameter. If that doesn't work, consider renaming your local folder to something else.
It's okay. I'm the one who's learning and asking questions. I changed the local absolute path and changed the name of the pre-trained model, but it still didn't work. May I ask is there any other way? If I don't download the pre-trained model locally, I'll have a network problem like the one shown here. I really don't know what to do (crying and laughing), looking forward to your help, thank you.
Typically, setting --pretrained_diffusion_path="stabilityai/stable-diffusion-2-base" should automatically download the weights. The error message shown in the screenshot still seems to be related to a network connection issue. Have you tried the potential solutions mentioned here?
Hello, because I am busy with other things at this time, so I have delayed this. I re-downloaded your project and tried to replace the versions of the request and urllib3 libraries, but I still had this connection problem. Also, I downloaded stable-diffusion-2-base locally, but I didn't use it. I just downloaded the project, and then hooked up the vpn to run it directly, but the following problems kept appearing. Is there a problem with the process of my running the project? Could you help me, please? Thank you. It's so much trouble. If possible, it would be best to add your contact information, so that I can consult you more easily, because I do encounter this problem is rather difficult. It's perfectly normal for you to say no. Thank you again.
The following is the error message:
File "F:\Anaconda2023\anaconda3\envs\diffattack\lib\site-packages\requests\adapters.py", line 517, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: (MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /api/models/stabilityai/stable-diffusion-2-base (Caused by SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1135)')))"), '(Request ID: 38dcc369-6bd4-4e11-988c-2d545872bbb3)')
The previous problem has been solved, because the hanging vpn only proxy browser, no proxy Pycharm. Now this problem has arisen, may I ask what the problem is, thank you very much
Attack based on Diffusion, Attacked Dataset: imagenet_compatible***
vae\diffusion_pytorch_model.safetensors not found
Fetching 13 files: 0%| | 0/13 [00:00<?, ?it/s]
Activity
[-]运行出问题[/-][+]run-time error[/+]WindVChen commentedon Jul 8, 2024
Hi @zhangfeng0617 ,
I didn't encounter such an issue before, but maybe you can have a look at this issue huggingface/transformers#17611 which is quite similar.
Besides, there could also sometimes be internet problem. You can also have a try to add this script at the start of the code (refer to CompVis/stable-diffusion#302 (comment)):
If you want to load the pre-trained model from the local machine, you may need to ensure downloading the correct type of files. Below is the needed file list of Stable Diffusion:

zhangfeng0617 commentedon Jul 8, 2024
Thanks for your reply, can you give me a link to the pre-training model of this project? Maybe my pre-training model is not in the right file. thank you
WindVChen commentedon Jul 8, 2024
Hi, you can find these files here.
zhangfeng0617 commentedon Jul 9, 2024
thank you! thank you!
zhangfeng0617 commentedon Jul 10, 2024
I downloaded the pre-training model to the local, there is this problem, hope you can help to answer it, thank you

Attack based on Diffusion***
Traceback (most recent call last):
File "main.py", line 114, in
ldm_stable = StableDiffusionPipeline.from_pretrained(pretrained_diffusion_path).to('cuda:0')
File "F:\Anaconda2023\anaconda3\envs\diffattack\lib\site-packages\diffusers\pipelines\pipeline_utils.py", line 1037, in from_pretrained
loaded_sub_model = load_sub_model(
File "F:\Anaconda2023\anaconda3\envs\diffattack\lib\site-packages\diffusers\pipelines\pipeline_utils.py", line 450, in load_sub_model
loaded_sub_model = load_method(os.path.join(cached_folder, name), **loading_kwargs)
File "F:\Anaconda2023\anaconda3\envs\diffattack\lib\site-packages\transformers\tokenization_utils_base.py", line 2094, in from_pretrained
raise EnvironmentError(
OSError: Can't load tokenizer for 'stabilityai/stable-diffusion-2-base\tokenizer'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'stabilityai/stable-diffusion-2-base\tokenizer' is the correct path to a directory containing all relevant files for a CLIPTokenizer tokenizer.
Process finished with exit code 1

thanks!
WindVChen commentedon Jul 10, 2024
Hi,
Could you please let me know the level of file path you passed into the code?
For example, here's my local save path:
And it should work when setting the
--pretrained_diffusion_path="C:\Users\PC\.cache\huggingface\diffusers\models--stabilityai--stable-diffusion-2-base\snapshots\455a0f46082..."in the main.py.zhangfeng0617 commentedon Jul 11, 2024
This is the previous version you published, but it does not affect. I put the pre-trained model downloaded from the link you sent above into the project, and I also loaded it directly in the code. As shown in the figure. I see you put it under the C drive path, is that the reason? In addition, the pre-trained model I downloaded does not have huggingface\diffusers\ in front, is this affecting the operation? thank you


WindVChen commentedon Jul 11, 2024
Ah, I think I understand the issue now.
I apologize for the confusion regarding the path specified in the code:
--pretrained_diffusion_path="stabilityai/stable-diffusion-2-base". The valuestabilityai/stable-diffusion-2-basedoes not refer to a local path. Instead, it points to the Hugging Face repositorystabilityai/stable-diffusion-2-basefrom which the necessary weights will be downloaded automatically.The error message you encountered previously might be due to a name collision if you have a local directory with the same name as the Hugging Face repository. To resolve this, please try using an absolute path for the
--pretrained_diffusion_pathparameter. If that doesn't work, consider renaming your local folder to something else.zhangfeng0617 commentedon Jul 13, 2024
It's okay. I'm the one who's learning and asking questions. I changed the local absolute path and changed the name of the pre-trained model, but it still didn't work. May I ask is there any other way? If I don't download the pre-trained model locally, I'll have a network problem like the one shown here. I really don't know what to do (crying and laughing), looking forward to your help, thank you.

WindVChen commentedon Jul 13, 2024
Emm, that's a bit weird.
Typically, setting --pretrained_diffusion_path="stabilityai/stable-diffusion-2-base" should automatically download the weights. The error message shown in the screenshot still seems to be related to a network connection issue. Have you tried the potential solutions mentioned here?
zhangfeng0617 commentedon Jul 13, 2024
I tried the method but it didn't work. I will download your project again and try it. Thank you very much for your trouble.
WindVChen commentedon Jul 13, 2024
Sorry it didn't work out :( Please keep me informed if you manage to identify the issue.
zhangfeng0617 commentedon Aug 14, 2024
Hello, because I am busy with other things at this time, so I have delayed this. I re-downloaded your project and tried to replace the versions of the request and urllib3 libraries, but I still had this connection problem. Also, I downloaded stable-diffusion-2-base locally, but I didn't use it. I just downloaded the project, and then hooked up the vpn to run it directly, but the following problems kept appearing. Is there a problem with the process of my running the project? Could you help me, please? Thank you. It's so much trouble. If possible, it would be best to add your contact information, so that I can consult you more easily, because I do encounter this problem is rather difficult. It's perfectly normal for you to say no. Thank you again.
The following is the error message:
File "F:\Anaconda2023\anaconda3\envs\diffattack\lib\site-packages\requests\adapters.py", line 517, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: (MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /api/models/stabilityai/stable-diffusion-2-base (Caused by SSLError(SSLZeroReturnError(6, 'TLS/SSL connection has been closed (EOF) (_ssl.c:1135)')))"), '(Request ID: 38dcc369-6bd4-4e11-988c-2d545872bbb3)')
WindVChen commentedon Aug 20, 2024
Hi @zhangfeng0617 ,
Apologies for the delayed response—things have been quite busy on my end as well.
Please feel free to send an email to windvchen@gmail.com, and I'll share my personal contact details there.
zhangfeng0617 commentedon Aug 22, 2024
Ok, thank you, now I am busy with some other things, I will contact you when the school starts, thank you very much
zhangfeng0617 commentedon Sep 10, 2024
The previous problem has been solved, because the hanging vpn only proxy browser, no proxy Pycharm. Now this problem has arisen, may I ask what the problem is, thank you very much
Attack based on Diffusion, Attacked Dataset: imagenet_compatible***
vae\diffusion_pytorch_model.safetensors not found
Fetching 13 files: 0%| | 0/13 [00:00<?, ?it/s]
WindVChen commentedon Sep 10, 2024
Hi,
From the error message, you may need to check if you've downloaded
diffusion_pytorch_model.safetensorsunder the foldervae.Below are the files under my folder:
