Open zhangfeng0617 opened 2 months ago
Hi @zhangfeng0617 ,
I didn't encounter such an issue before, but maybe you can have a look at this issue https://github.com/huggingface/transformers/issues/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 https://github.com/CompVis/stable-diffusion/issues/302#issuecomment-2042642642):
import os
os.environ['HF_ENDPOINT']='https://hf-mirror.com'
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
thank you! 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
Process finished with exit code 1
thanks!
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.
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
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 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.
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?
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.
Sorry it didn't work out :( Please keep me informed if you manage to identify the issue.
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)')
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.
Ok, thank you, now I am busy with some other things, I will contact you when the school starts, thank you very much
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
![image](https://github.com/WindVChen/DiffAttack/assets/50318773/1e8d3c21-7987-4d8d-81fe-19e59c6bfa5a)