0

I signed up for some pay as you go credit - and to my dismay now receive this error both on Disco AND Stable Diffusion:

FileNotFoundError                         Traceback (most recent call last)
<ipython-input-4-191981527364> in <module>
     38 import py3d_tools as p3d
     39 
---> 40 from helpers import DepthModel, sampler_fn
     41 from k_diffusion.external import CompVisDenoiser
     42 from ldm.util import instantiate_from_config

4 frames
/content/MiDaS/midas/backbones/next_vit.py in <module>
      6 from .utils import activations, forward_default, get_activation
      7 
----> 8 file = open("./externals/Next_ViT/classification/nextvit.py", "r")
      9 source_code = file.read().replace(" utils", " externals.Next_ViT.classification.utils")
     10 exec(source_code)

FileNotFoundError: [Errno 2] No such file or directory: './externals/Next_ViT/classification/nextvit.py'

I also receive this error on Stable:

NameError                                 Traceback (most recent call last)
<ipython-input-5-d64464a7a6a5> in <module>
    154 if load_on_run_all and ckpt_valid:
    155     local_config = OmegaConf.load(f"{ckpt_config_path}")
--> 156     model = load_model_from_config(local_config, f"{ckpt_path}", half_precision=half_precision)
    157     device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
    158     model = model.to(device)

<ipython-input-5-d64464a7a6a5> in load_model_from_config(config, ckpt, verbose, device, half_precision)
    136         print(f"Global Step: {pl_sd['global_step']}")
    137     sd = pl_sd["state_dict"]
--> 138     model = instantiate_from_config(config.model)
    139     m, u = model.load_state_dict(sd, strict=False)
    140     if len(m) > 0 and verbose:

Despite clearing my Google Drive and reloading Disco and Stable Diffusion, (including the .ckpt file, placed correctly as before in the models folder) the same errors occur.

kate kate
  • 11
  • 3
  • Can you confirm that the file `./externals/Next_ViT/classification/nextvit.py` exists? – karatekraft Dec 26 '22 at 18:34
  • Thanks for replying - I know this is going to sound really dumb - but I didn't understand how to follow the file path. So No. I searched for it using the Magnifier tool and found nothing. Thanks again. – kate kate Dec 26 '22 at 18:41
  • Can I just add that this seems to be the same issue: https://stackoverflow.com/questions/74913078/filenotfounderror-errno-2-no-such-file-or-directory-externals-next-vit – kate kate Dec 26 '22 at 18:47
  • No problem. You can run `!head ./externals/Next_ViT/classification/nextvit.py` in a new cell. It should show the first few lines of that file if it exists. Or google colab has a file menu on the left side and try to find it there. But it looks like a stable diffusion related bug. Maybe take a look at this thread for some ideas? https://www.reddit.com/r/StableDiffusion/comments/zu720s/deforum_filenotfounderror_errno_2_no_such_file_or/ – karatekraft Dec 26 '22 at 19:36
  • Thank you SO much. I added a new cell and added the line of code you suggested. I then 'pressed play' (sorry to be such a beginner!) and got: head: cannot open './externals/Next_ViT/classification/nextvit.py' for reading: No such file or directory Thank you also for the link. Thanks again! – kate kate Dec 26 '22 at 20:15
  • @karatekraft Thanks for commenting on the other Stack Overflow. Much appreciated! – kate kate Dec 26 '22 at 20:54
  • PART SOLVED: Thanks Sooo much KKraft. The new .06 notebook works for me re. Stable Diffusion: https://colab.research.google.com/github/deforum-art/deforum-stable-diffusion/blob/main/Deforum_Stable_Diffusion.ipynb#scrollTo=XVzhbmizWM_u Nb. It works with default v1-5-pruned-emaonly.ckpt but asked me for for hugging face id and token.... So... re. token I just typed in sd-v1-4.ckpt and bizarrely it worked! I also tried it with my old sd-v1-4.ckpt selected on the dropdown (instead of default v1-5-pruned-emaonly.ckpt) and that worked too. Haven't tried Disco yet... – kate kate Dec 27 '22 at 13:03
  • REMAINING DISCO PROB: This still isn't working - and have seen loads of comments on Discord about the same issue. Meanwhile, I think 1.4 (containing the Midas error) can be deleted if you're not doing 3D animation. (All still worked for me on still image generation anyhow): https://medium.com/axinc-ai/midas-a-machine-learning-model-for-depth-estimation-e96119cc1a3c – kate kate Dec 27 '22 at 15:52
  • 1
    SOLVED! (Thanks to someone else way cleverer than me): https://www.youtube.com/watch?v=tIo0b0YJ2GA&t=10s – kate kate Dec 27 '22 at 17:07

0 Answers0