Skip to content

TensorFlow render engine generates a "no such file or directory" error #17

Description

@brendensuarez

Steps to reproduce

  • start the web UI from CLI
  • run a prompt with default settings
  • change Render Engine in Advanced Settings from Diffusers to TensorFlow
  • run the same prompt that just worked
  • an error is produced in about 10-20 seconds from the start of generation:

FileNotFoundError: [Errno 2] Unable to synchronously open file (unable to open file: name = 'runwayml/stable-diffusion-v1-5/text_encoder.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)

CLI output

Switching to TensorFlow Keras render engine...

...using regular precision (FP32)...

Using GPU to render:
 Radeon Pro Vega 20

Critical changes made for creation, compiling/building new model

New inputs: TensorFlow 
 Width: 512 Height: 512 Batch Size: 1 
  Embeddings: None 
   ControlNet: None 
    LoRAs:
[]

     Token Merging Strength: 0.5 
      CLIP Skip: 0

Old inputs: Diffusers 
 Width: 512 Height: 512 Batch Size: 1 
  Embeddings: None 
   ControlNet: None 
    LoRAs:
[]

     Token Merging Strength: 0.5 
      CLIP Skip: 0

Starting Stable Diffusion with 🧊 TensorFlow 🧊

NOTE: Model will be downloaded into cache from Hugging Face

Ignoring Text Embeddings

Creating models in legacy mode...
Created text encoder model
Created diffusion model
Created decoder model
Created encoder model

Loading Keras weights for: runwayml/stable-diffusion-v1-5
Traceback (most recent call last):
  File "/Users/brenden/Developer/lab/metaldiffusion/MetalDiffusion/venv/lib/python3.9/site-packages/gradio/routes.py", line 534, in predict
    output = await route_utils.call_process_api(
  File "/Users/brenden/Developer/lab/metaldiffusion/MetalDiffusion/venv/lib/python3.9/site-packages/gradio/route_utils.py", line 226, in call_process_api
    output = await app.get_blocks().process_api(
  File "/Users/brenden/Developer/lab/metaldiffusion/MetalDiffusion/venv/lib/python3.9/site-packages/gradio/blocks.py", line 1550, in process_api
    result = await self.call_function(
  File "/Users/brenden/Developer/lab/metaldiffusion/MetalDiffusion/venv/lib/python3.9/site-packages/gradio/blocks.py", line 1185, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "/Users/brenden/Developer/lab/metaldiffusion/MetalDiffusion/venv/lib/python3.9/site-packages/anyio/to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
  File "/Users/brenden/Developer/lab/metaldiffusion/MetalDiffusion/venv/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 2461, in run_sync_in_worker_thread
    return await future
  File "/Users/brenden/Developer/lab/metaldiffusion/MetalDiffusion/venv/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 962, in run
    result = context.run(func, *args)
  File "/Users/brenden/Developer/lab/metaldiffusion/MetalDiffusion/venv/lib/python3.9/site-packages/gradio/utils.py", line 661, in wrapper
    response = f(*args, **kwargs)
  File "/Users/brenden/Developer/lab/metaldiffusion/MetalDiffusion/dream.py", line 522, in create
    self.compileDreams(embeddingChoices = embeddingChoices, useControlNet = useControlNet)
  File "/Users/brenden/Developer/lab/metaldiffusion/MetalDiffusion/dream.py", line 340, in compileDreams
    self.generator = StableDiffusion(
  File "/Users/brenden/Developer/lab/metaldiffusion/MetalDiffusion/stableDiffusionTensorFlow/stableDiffusion.py", line 177, in __init__
    self.setWeights(weights, VAE)
  File "/Users/brenden/Developer/lab/metaldiffusion/MetalDiffusion/stableDiffusionTensorFlow/stableDiffusion.py", line 603, in setWeights
    loadWeightsFromKeras(
  File "/Users/brenden/Developer/lab/metaldiffusion/MetalDiffusion/stableDiffusionTensorFlow/stableDiffusion.py", line 734, in loadWeightsFromKeras
    models.text_encoder.load_weights(textEncoderWeights)
  File "/Users/brenden/Developer/lab/metaldiffusion/MetalDiffusion/venv/lib/python3.9/site-packages/keras/utils/traceback_utils.py", line 70, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "/Users/brenden/Developer/lab/metaldiffusion/MetalDiffusion/venv/lib/python3.9/site-packages/h5py/_hl/files.py", line 564, in __init__
    fid = make_fid(name, mode, userblock_size, fapl, fcpl, swmr=swmr)
  File "/Users/brenden/Developer/lab/metaldiffusion/MetalDiffusion/venv/lib/python3.9/site-packages/h5py/_hl/files.py", line 238, in make_fid
    fid = h5f.open(name, flags, fapl=fapl)
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py/h5f.pyx", line 102, in h5py.h5f.open
FileNotFoundError: [Errno 2] Unable to synchronously open file (unable to open file: name = 'runwayml/stable-diffusion-v1-5/text_encoder.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions