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

Colab error : Basicsr module not found and then crashes #25

Closed
jarredou opened this issue Jul 12, 2022 · 5 comments
Closed

Colab error : Basicsr module not found and then crashes #25

jarredou opened this issue Jul 12, 2022 · 5 comments

Comments

@jarredou
Copy link

jarredou commented Jul 12, 2022

I was playing since some days with my own instance on Colab, all was working like a charm, but today, it doesn't work anymore.
Fearing I have misstyped something, I went back to the original instance hosted here, but I'm still getting the same error, that is happening when using GFPGAN upscaling:

Sampling images 1/1
Data shape for DDIM sampling is (1, 4, 32, 32), eta 1.3
Running DDIM Sampling with 119 timesteps
DDIM Sampler: 100%
119/119 [02:06<00:00, 1.01it/s]
/content/GFPGAN
Traceback (most recent call last):
  File "inference_gfpgan.py", line 9, in <module>
    from gfpgan import GFPGANer
  File "/content/GFPGAN/gfpgan/__init__.py", line 4, in <module>
    from .models import *
  File "/content/GFPGAN/gfpgan/models/__init__.py", line 10, in <module>
    _model_modules = [importlib.import_module(f'gfpgan.models.{file_name}') for file_name in model_filenames]
  File "/content/GFPGAN/gfpgan/models/__init__.py", line 10, in <listcomp>
    _model_modules = [importlib.import_module(f'gfpgan.models.{file_name}') for file_name in model_filenames]
  File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/content/GFPGAN/gfpgan/models/gfpgan_model.py", line 6, in <module>
    from basicsr.losses.losses import r1_penalty
ModuleNotFoundError: No module named 'basicsr.losses.losses'
/content
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
[<ipython-input-13-6ec39f84cd27>](https://localhost:8080/#) in <module>()
    147       fps = 24
    148       p = Popen(['ffmpeg', '-y', '-f', 'image2pipe', '-vcodec', 'png', '-r', str(fps), '-i', '-', '-vcodec', 'libx264', '-r', str(fps), '-pix_fmt', 'yuv420p', '-crf', '17', '-preset', 'veryslow', 'video.mp4'], stdin=PIPE)
--> 149   do_run()
    150   if generate_video:
    151       p.stdin.close()

1 frames
[<ipython-input-8-0502eee025d5>](https://localhost:8080/#) in fetch(url_or_path)
    124         fd.seek(0)
    125         return fd
--> 126     return open(url_or_path, 'rb')
    127 
    128 

FileNotFoundError: [Errno 2] No such file or directory: 'GFPGAN/results/restored_imgs/temp_1657646799.png'
@jarredou
Copy link
Author

jarredou commented Jul 12, 2022

I've also commented out the downgrade lines in the installation cell, as it was throwing a weird error (reported => #24).

All was working with a T4 GPU until the error reported above.

@jarredou
Copy link
Author

jarredou commented Jul 12, 2022

Ok. Found the source of this error. It seems that BasicSR was recently updated to 1.4 and this is causing this error.
No error when downgraded with basicsr==1.3.5 in the installation process !

@Dango233
Copy link
Collaborator

Dango233 commented Jul 13, 2022 via email

@apolinario
Copy link
Contributor

apolinario commented Jul 13, 2022

I have changed the version to basicsr==1.3.5 in the installation process and already pushed the change. To me this hasn't fully fixed the issue so I'm further investigating

@apolinario
Copy link
Contributor

Okay, got it:
GFPGAN fixed their compatibility problem with the new basicsr version. So now downgrading it to basicsr=1.3.5 broke things in the other direction. The original code is working normally now for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants