Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: FileNotFoundError #11578

Closed
1 task done
LodeSnaet opened this issue Jul 2, 2023 · 5 comments
Closed
1 task done

[Bug]: FileNotFoundError #11578

LodeSnaet opened this issue Jul 2, 2023 · 5 comments
Labels
bug-report Report of a bug, yet to be confirmed

Comments

@LodeSnaet
Copy link

Is there an existing issue for this?

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

What happened?

After generating an inpainted mesh a depth map and a normal .obj file I get this error

Traceback (most recent call last):
File "C:\Users\lodes\AI_UIs\Image_AI\automatic1111\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 422, in run_predict
output = await app.get_blocks().process_api(
File "C:\Users\lodes\AI_UIs\Image_AI\automatic1111\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1326, in process_api
data = self.postprocess_data(fn_index, result["prediction"], state)
File "C:\Users\lodes\AI_UIs\Image_AI\automatic1111\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1260, in postprocess_data
prediction_value = block.postprocess(prediction_value)
File "C:\Users\lodes\AI_UIs\Image_AI\automatic1111\stable-diffusion-webui\venv\lib\site-packages\gradio\components.py", line 4461, in postprocess
file = self.pil_to_temp_file(img, dir=self.DEFAULT_TEMP_DIR)
File "C:\Users\lodes\AI_UIs\Image_AI\automatic1111\stable-diffusion-webui\modules\ui_tempdir.py", line 55, in save_pil_to_file
file_obj = tempfile.NamedTemporaryFile(delete=False, suffix=".png", dir=dir)
File "C:\Users\lodes\AppData\Local\Programs\Python\Python310\lib\tempfile.py", line 559, in NamedTemporaryFile
file = _io.open(dir, mode, buffering=buffering,
File "C:\Users\lodes\AppData\Local\Programs\Python\Python310\lib\tempfile.py", line 556, in opener
fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
File "C:\Users\lodes\AppData\Local\Programs\Python\Python310\lib\tempfile.py", line 256, in _mkstemp_inner
fd = os.open(file, flags, 0o600)
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\lodes\AppData\Local\Temp\gradio\tmp4mdv1tl
.png'

idk if I this is a bug or an error on my side that I forgot to do something I just installed the repo using the URL in auto1111

Steps to reproduce the problem

  1. Go to ....
  2. Press ....
  3. ...

What should have happened?

it should give me the requested generation files

Version or Commit where the problem happens

Version: v1.4.0 Commit hash: 394ffa7

What Python version are you running on ?

Python 3.10.x

What platforms do you use to access the UI ?

Windows

What device are you running WebUI on?

Nvidia GPUs (RTX 20 above)

Cross attention optimization

Automatic

What browsers do you use to access the UI ?

Microsoft Edge

Command Line Arguments

nope

List of extensions

nope, only extension is this one it's a fresh install

Console logs

venv "C:\Users\lodes\AI_UIs\Image_AI\automatic1111\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.4.0
Commit hash: 394ffa7b0a7fff3ec484bcd084e673a8b301ccc8
Installing requirements
Installing imageio-ffmpeg requirement for depthmap script
Installing pyqt5 requirement for depthmap script

Launching Web UI with arguments:
No module 'xformers'. Proceeding without it.
Loading weights [6ce0161689] from C:\Users\lodes\AI_UIs\Image_AI\automatic1111\stable-diffusion-webui\models\Stable-diffusion\v1-5-pruned-emaonly.safetensors
preload_extensions_git_metadata for 8 extensions took 0.29s
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 17.8s (import torch: 3.9s, import gradio: 2.6s, import ldm: 1.0s, other imports: 2.4s, setup codeformer: 0.2s, load scripts: 6.1s, create ui: 1.1s, gradio launch: 0.4s).
Creating model from config: C:\Users\lodes\AI_UIs\Image_AI\automatic1111\stable-diffusion-webui\configs\v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Applying attention optimization: Doggettx... done.
Textual inversion embeddings loaded(0):
Model loaded in 15.8s (load weights from disk: 1.6s, create model: 0.8s, apply weights to model: 8.8s, apply half(): 1.9s, move model to device: 2.5s, calculate empty prompt: 0.1s).

DepthMap v0.3.12 (e20abe94)
device: cuda
Loading model weights from  ./models/leres/res101.pth
initialize network with normal
loading the model from ./models/pix2pix\latest_net_G.pth
Computing depthmap(s) ..
  0%|                                                                                            | 0/1 [00:00<?, ?it/s]

wholeImage being processed in : 1568
Adjust factor is: 1.0
Selecting patches ...
Target resolution:  (1792, 3136, 3)
Resulting depthmap resolution will be : (1024, 1792)
patches to process: 8
         processing patch 0 / 7 | [686 110 677 677]
         processing patch 1 / 7 | [878 110 677 677]
         processing patch 2 / 7 | [722 338 603 603]
         processing patch 3 / 7 | [357 357 567 567]
         processing patch 4 / 7 | [174 366 549 549]
         processing patch 5 / 7 | [  0   0 512 512]
         processing patch 6 / 7 | [  0 192 512 512]
         processing patch 7 / 7 | [  0 384 512 512]

Generating (occluded) mesh ..
100%|████████████████████████████████████████████████████████████████████████████████████| 1/1 [01:33<00:00, 93.30s/it]
Done.
Running 3D Photo Inpainting ..
Loading edge model ..
Loading depth model ..
Loading rgb model ..
  0%|                                                                                            | 0/1 [00:00<?, ?it/s]
Generating inpainted mesh .. (go make some coffee) ..
Generating faces: 100%|█████████████████████████████████████████████████████████████████| 7/7 [16:35<00:00, 142.15s/it]
Writing mesh file outputs/extras-images\depthmap-0001.obj ...███████████████████████████| 7/7 [16:35<00:00, 114.40s/it]
Saving faces: 100%|████████████████████████████████████████████████████| 16333277/16333277 [00:50<00:00, 323425.16it/s]
100%|██████████████████████████████████████████████████████████████████████████████████| 1/1 [18:05<00:00, 1085.24s/it]
All done.
Traceback (most recent call last):
  File "C:\Users\lodes\AI_UIs\Image_AI\automatic1111\stable-diffusion-webui\venv\lib\site-packages\gradio\routes.py", line 422, in run_predict
    output = await app.get_blocks().process_api(
  File "C:\Users\lodes\AI_UIs\Image_AI\automatic1111\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1326, in process_api
    data = self.postprocess_data(fn_index, result["prediction"], state)
  File "C:\Users\lodes\AI_UIs\Image_AI\automatic1111\stable-diffusion-webui\venv\lib\site-packages\gradio\blocks.py", line 1260, in postprocess_data
    prediction_value = block.postprocess(prediction_value)
  File "C:\Users\lodes\AI_UIs\Image_AI\automatic1111\stable-diffusion-webui\venv\lib\site-packages\gradio\components.py", line 4461, in postprocess
    file = self.pil_to_temp_file(img, dir=self.DEFAULT_TEMP_DIR)
  File "C:\Users\lodes\AI_UIs\Image_AI\automatic1111\stable-diffusion-webui\modules\ui_tempdir.py", line 55, in save_pil_to_file
    file_obj = tempfile.NamedTemporaryFile(delete=False, suffix=".png", dir=dir)
  File "C:\Users\lodes\AppData\Local\Programs\Python\Python310\lib\tempfile.py", line 559, in NamedTemporaryFile
    file = _io.open(dir, mode, buffering=buffering,
  File "C:\Users\lodes\AppData\Local\Programs\Python\Python310\lib\tempfile.py", line 556, in opener
    fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
  File "C:\Users\lodes\AppData\Local\Programs\Python\Python310\lib\tempfile.py", line 256, in _mkstemp_inner
    fd = _os.open(file, flags, 0o600)
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\lodes\\AppData\\Local\\Temp\\gradio\\tmp4mdv1tl_.png'

Additional information

No response

@LodeSnaet LodeSnaet added the bug-report Report of a bug, yet to be confirmed label Jul 2, 2023
@docentYT
Copy link

docentYT commented Jul 8, 2023

I have the same problem on the latest version of webui.

@docentYT
Copy link

docentYT commented Jul 8, 2023

#10787

@longlivebigcat
Copy link

A walkaround for this problem on Windows PC is:

  1. Go to your %temp% folder by typing %temp% in your file browser path windows, it is usually like "C:\Users'Your Username'\AppData\Local\Temp"
  2. Manually create a folder called "gradio"

Then generate image again, it works

@z1006
Copy link

z1006 commented Aug 15, 2023

I ran into the same problem on macOS. I tried to check the options below and now it seems that the problem has been solved.

Setting -> Saving images/grids -> Cleanup non-default temporary directory when starting webui

@catboxanon
Copy link
Collaborator

Fixed in #12717

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Report of a bug, yet to be confirmed
Projects
None yet
Development

No branches or pull requests

5 participants