fast-stable-diffusion
fast-stable-diffusion copied to clipboard
Error when trying to run notebook all of a sudden
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
[<ipython-input-12-55b102f3c5f0>](https://localhost:8080/#) in <module>
44 if Use_Gradio_Server:
45 share='--share'
---> 46 for line in fileinput.input('/usr/local/lib/python3.7/dist-packages/gradio/blocks.py', inplace=True):
47 if line.strip().startswith('self.server_name ='):
48 line = ' self.server_name = server_name\n'
1 frames
[/usr/lib/python3.8/fileinput.py](https://localhost:8080/#) in _readline(self)
340 pass
341 # The next few lines may raise OSError
--> 342 os.rename(self._filename, self._backupfilename)
343 self._file = open(self._backupfilename, self._mode)
344 try:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.7/dist-packages/gradio/blocks.py' -> '/usr/local/lib/python3.7/dist-packages/gradio/blocks.py.bak'
Happens every single time now. Was working an hour ago...
colab switched to python 3.8, I'm waiting for a confirmation from multiple users to adjust the colabs
Ah, okay
colab switched to python 3.8, I'm waiting for a confirmation from multiple users to adjust the colabs
Are you saying that you need a certain threshold of people reporting the same error? I was experiencing the same error myself, but after a few times restarting all the cells it switched to a different error (ModuleNotFoundError: No module named 'git')
Of course, that could be a different issue entirely, but I felt it'd be better if I mention it.
My colab is at python3.8 too. Changing the paths for the patches works for me, but there are multiple other dependencies missing.
Can also confirm that I'm getting the same error on my colab.
--------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) [<ipython-input-12-55b102f3c5f0>](https://localhost:8080/#) in <module> 44 if Use_Gradio_Server: 45 share='--share' ---> 46 for line in fileinput.input('/usr/local/lib/python3.7/dist-packages/gradio/blocks.py', inplace=True): 47 if line.strip().startswith('self.server_name ='): 48 line = ' self.server_name = server_name\n' 1 frames [/usr/lib/python3.8/fileinput.py](https://localhost:8080/#) in _readline(self) 340 pass 341 # The next few lines may raise OSError --> 342 os.rename(self._filename, self._backupfilename) 343 self._file = open(self._backupfilename, self._mode) 344 try: FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.7/dist-packages/gradio/blocks.py' -> '/usr/local/lib/python3.7/dist-packages/gradio/blocks.py.bak'
Happens every single time now. Was working an hour ago...
Came here to say this, got the same problem just now.
For me now appear this error:
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
[<ipython-input-6-3165d779d0bc>](https://localhost:8080/#) in <module>
60 srv= getoutput('cat /content/srvr.txt')
61
---> 62 for line in fileinput.input('/usr/local/lib/python3.7/dist-packages/gradio/blocks.py', inplace=True):
63 if line.strip().startswith('self.server_name ='):
64 line = f' self.server_name = "{srv[8:]}"\n'
1 frames
[/usr/lib/python3.8/fileinput.py](https://localhost:8080/#) in _readline(self)
340 pass
341 # The next few lines may raise OSError
--> 342 os.rename(self._filename, self._backupfilename)
343 self._file = open(self._backupfilename, self._mode)
344 try:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.7/dist-packages/gradio/blocks.py' -> '/usr/local/lib/python3.7/dist-packages/gradio/blocks.py.bak'
I can confirm as well
Here's a list of python modules that I had to install
!pip install GitPython jsonmerge einops clean-fid clip resize_right torchdiffeq lark omegaconf lpips basicsr pytorch_lightning piexif fonts triton
but it now fails like that
WARNING:root:A matching Triton is not available, some optimizations will not be enabled.
Error caught was: module 'triton.language' has no attribute 'constexpr'
/usr/local/lib/python3.8/dist-packages/pytorch_lightning/utilities/distributed.py:258: LightningDeprecationWarning: `pytorch_lightning.utilities.distributed.rank_zero_only` has been deprecated in v1.8.1 and will be removed in v1.10.0. You can import it from `pytorch_lightning.utilities` instead.
rank_zero_deprecation(
Traceback (most recent call last):
File "/content/gdrive/MyDrive/AI/thelastben_sd/stable-diffusion-webui/webui.py", line 14, in <module>
from modules import shared, devices, sd_samplers, upscaler, extensions, localization, ui_tempdir
File "/content/gdrive/MyDrive/AI/thelastben_sd/stable-diffusion-webui/modules/sd_samplers.py", line 11, in <module>
from modules import prompt_parser, devices, processing, images
File "/content/gdrive/MyDrive/AI/thelastben_sd/stable-diffusion-webui/modules/processing.py", line 15, in <module>
import modules.sd_hijack
File "/content/gdrive/MyDrive/AI/thelastben_sd/stable-diffusion-webui/modules/sd_hijack.py", line 10, in <module>
import modules.textual_inversion.textual_inversion
File "/content/gdrive/MyDrive/AI/thelastben_sd/stable-diffusion-webui/modules/textual_inversion/textual_inversion.py", line 13, in <module>
from modules import shared, devices, sd_hijack, processing, sd_models, images, sd_samplers
File "/content/gdrive/MyDrive/AI/thelastben_sd/stable-diffusion-webui/modules/images.py", line 16, in <module>
from fonts.ttf import Roboto
ImportError: cannot import name 'Roboto' from 'fonts.ttf' (/usr/local/lib/python3.8/dist-packages/fonts/ttf/__init__.py)
Also getting an error on xformers
"---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
ModuleNotFoundError: No module named 'wget'
NOTE: If your import is failing due to a missing package, you can manually install dependencies using either !pip or !apt.
To view examples of installing some common dependencies, click the "Open Examples" button below."
So I think I got it running by
- using colab's search and replace (menu edit), I replaced all occurrences of
python3.7
withpython3.8
- then in the first code block I added the following to deal with the missing dependencies:
!pip install GitPython jsonmerge einops clean-fid clip resize_right torchdiffeq lark omegaconf lpips basicsr pytorch_lightning piexif fonts font-roboto triton==2.0.0.dev20221120 transformers facexlib gfpgan realesrgan
It needs a high system RAM runtime in colab but now it runs fine.
Can you clarify what you mean by adding the code to the first block? Which block exactly>? The google drive one or the Setting up The Environment one? Just want to make sure I am doing it properly. Got collab pro, so ready to run at high ram. Hoping to get it resolved. Thanks in advance.
Here's where I've added the pip command that installs the dependencies:
Here's where I've added the pip command that installs the dependencies:
Ah, so to confirm that is for running the Automatic1111 Collab. Do we have a solution for the fast-dreambooth collab yet so I can train a model to THEN use in the Automatic? Going to try running automatic now anyways.

I know this may seem obvious - but how do I expand my the cell to view the whole code
It's already expanded, click after the closing brace and press enter on your keyboard for a new line
Thanks so much. I got automatic1111 up and running. Now - does the above technique also work for the fast-dreambooth collab? Have you tried it on that aswell yet?
Thanks again. Excited to continue working on things tonight.
IDK if it will work on dreambooth, but the same approach is most likely to work. In your place I'd do the same (https://github.com/TheLastBen/fast-stable-diffusion/issues/768#issuecomment-1332761995) and then if some python module is missing, I'd add it to the list of modules installed via !pip install <blabla>
I know Ben is working on things in the meantime. So hopefully it will be resolved soon enough regardless. I am curious to try it - but I am not familiar enough with knowing how to fix it if it doesnt work. I'll give it a shot now. (Edit - I cant run two high ram sessions at once. And I dont want to close my automatic at the moment. So going to have to wait to try it, or Ill wait till someone else reports if they do.)
IDK if it will work on dreambooth, but the same approach is most likely to work. In your place I'd do the same (#768 (comment)) and then if some python module is missing, I'd add it to the list of modules installed via
!pip install <blabla>
It's still broken even after this , doesn't do Save_Checkpoint_Every_n_Steps
skips it all together in collab
IDK if it will work on dreambooth, but the same approach is most likely to work. In your place I'd do the same (#768 (comment)) and then if some python module is missing, I'd add it to the list of modules installed via
!pip install <blabla>
It's still broken even after this , doesn't do
Save_Checkpoint_Every_n_Steps
skips it all together in collab
Are there any other ways for us to train models and then at least upload them from our drive into automatic1111? I tired one other collab for training by Shivam but that didnt work right now either.
At this point my strategy for getting fast-dreambooth working is just being patient while Ben works on it.
To confirm - has anyone been able to get fast-dreambooth working yet since the errors?
update the colab it should work now
update the colab it should work now
Trying it out now. When you say Update the Colab - does that just mean reload the page? Want to make sure I am not missing anything. Thanks Ben.
Tried running - get the error under "Setting Up the Environment"
"UsageError: Line magic function %%capture
not found."
the dreambooth colab isn't ready yet, the A1111 is
update the colab it should work now
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
[<ipython-input-5-e692ee13db33>](https://localhost:8080/#) in <module>
35 if Use_Gradio_Server:
36 share='--share'
---> 37 for line in fileinput.input('/usr/local/lib/python3.8/dist-packages/gradio/blocks.py', inplace=True):
38 if line.strip().startswith('self.server_name ='):
39 line = ' self.server_name = server_name\n'
1 frames
[/usr/lib/python3.8/fileinput.py](https://localhost:8080/#) in _readline(self)
340 pass
341 # The next few lines may raise OSError
--> 342 os.rename(self._filename, self._backupfilename)
343 self._file = open(self._backupfilename, self._mode)
344 try:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.8/dist-packages/gradio/blocks.py' -> '/usr/local/lib/python3.8/dist-packages/gradio/blocks.py.bak'
Is this fixed?
I can confirm there is no directory when searching for it in the path noted in the stack trace.
Any ideas on how to get this directory back in order?
Guys, in the meanwhile I recommend using this colab: https://github.com/ddPn08/automatic1111-colab
It works fine and has been working as a good replacement till Ben fixes this one! :)