bes-dev / stable_diffusion.openvino

Apache License 2.0
1.54k stars 205 forks source link

FileNotFoundError: [Errno 2] No such file or directory: 'file.lock' #84

Open justhereforhelppp opened 2 years ago

justhereforhelppp commented 2 years ago

File "C:\Users\USERNAME\AppData\Roaming\Python\Python39\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 562, in _run_script exec(code, module.dict)

File "C:\Users\USERNAME\Desktop\my things\programming\neural net\stable_diffusion.openvino\demo_web.py", line 124, in run(engine)

File "C:\Users\USERNAME\Desktop\my things\programming\neural net\stable_diffusion.openvino\demo_web.py", line 77, in run image = engine(

File "C:\Users\USERNAME\Desktop\my things\programming\neural net\stable_diffusion.openvino\stable_diffusion_engine.py", line 179, in call increment_lock()

File "C:\Users\USERNAME\Desktop\my things\programming\neural net\stable_diffusion.openvino\stable_diffusion_engine.py", line 218, in increment_lock with open("file.lock", "r") as f:

0xBYTESHIFT commented 2 years ago

it happens to me all the time too

Drake53 commented 2 years ago

It's funny when people use the code from one of the forks and then come here to ask for help. Anyways the solution is very simple, just delete the file lock code.

justhereforhelppp commented 2 years ago

It's funny when people use the code from one of the forks and then come here to ask for help.

Sorry, where should I ask in the future?

Drake53 commented 2 years ago

Well I guess here is the right place since opening an issue in a fork is disabled by default for some reason.

The main problem with your question was that the stacktrace shows the error is on line 218 of stable_diffusion_engine.py, but in the main repository this file only has 212 lines. It would've helped if you showed what the changes looked like or where you got the changes from.

justhereforhelppp commented 2 years ago

Well I guess here is the right place since opening an issue in a fork is disabled by default for some reason.

The main problem with your question was that the stacktrace shows the error is on line 218 of stable_diffusion_engine.py, but in the main repository this file only has 212 lines. It would've helped if you showed what the changes looked like or where you got the changes from.

Alright, thank you! Your solution actually worked for me aside from the fact it only generates noise instead of images, regardless of what I set the settings to:

image

image

image image

Drake53 commented 2 years ago

Can you try running the example in the readme and see if that works? Also check if you still have any changes in the .py files which may mess things up.

justhereforhelppp commented 2 years ago

Can you try running the example in the readme and see if that works?

Still generates noise, sadly

image

...check if you still have any changes in the .py files which may mess things up.

Replacing the .py files with the unedited versions still gives the 'file.lock' error :(

image
Drake53 commented 2 years ago

Try using the .py files from this repository (these should not have the file.lock error).

justhereforhelppp commented 2 years ago

Try using the .py files from this repository (these should not have the file.lock error).

Thank you 🤗

image

Is there a way to use other models with this? I have .ckpt files on my computer but using --model doesn't seem to work for me.

Drake53 commented 2 years ago

The model has to be converted into a format that can be used by openVINO. I don't know how to convert a .ckpt file though, I had the same question in #75