advimman / lama

🦙 LaMa Image Inpainting, Resolution-robust Large Mask Inpainting with Fourier Convolutions, WACV 2022
https://advimman.github.io/lama-project/
Apache License 2.0
8.14k stars 864 forks source link

FileNotFoundError: [Errno 2] No such file or directory: '/content/output/1_mask.png' #245

Closed jadewu9 closed 1 year ago

jadewu9 commented 1 year ago

这个文件夹是在哪创建的,找了一通也没找见相关代码把这个文件夹创建出来

jadewu9 commented 1 year ago

就是这个colab的实例,想着看一看来的

jadewu9 commented 1 year ago

也找不到这个保存修复后图像的代码

MacM2Pro commented 1 year ago

Same error as

82

197

213

240

Last year Colab worked great but I'm also having this error now. I think #240 and #243 solutions fix some part of the problems but inpainting still doesn't work.

Xinshuai-Lyu commented 1 year ago

Copy_of_LaMa_inpainting.ipynb.zip

  1. Download my colab
  2. edit /content/lama/saicinpainting/training/modules/fake_fakes.py, you need to change from kornia import SamplePadding to from kornia.constants import SamplePadding
  3. edit /content/lama/bin/predict.py, you need to change device = torch.device(predict_config.device) (line 43) to device = torch.device("cpu") WX20230802-004026
nikprt commented 1 year ago

@Xinshuai-Lyu I followed your changes but in the step of inpainting, I am still getting the error: FileNotFoundError: [Errno 2] No such file or directory: '/content/output/1224276_original_mask.png'

Looking into the predict.log file in the outputs folder shows this:

[2023-11-02 11:30:50,933][saicinpainting.utils][WARNING] - Setting signal 10 handler <function print_traceback_handler at 0x7eda504a9ea0> [2023-11-02 11:30:50,933][__main__][CRITICAL] - Prediction failed due to [Errno 2] No such file or directory: '/content/lama/big-lama/config.yaml': Traceback (most recent call last): File "/content/lama/bin/predict.py", line 46, in main with open(train_config_path, 'r') as f: FileNotFoundError: [Errno 2] No such file or directory: '/content/lama/big-lama/config.yaml'

It seems that somehow, the folder /big-lama/ is not created and therefore I cannot fand any "config.yaml". Would appreciate some help here if anyone knows how to fix this!

Xinshuai-Lyu commented 1 year ago

@nikprt

!curl -L $(yadisk-direct https://disk.yandex.ru/d/ouP6l8VJ0HpMZg) -o big-lama.zip

The above link is broken, find this and replace it with:

!curl -LJO https://huggingface.co/smartywu/big-lama/resolve/main/big-lama.zip

nikprt commented 1 year ago

@Xinshuai-Lyu thanks for your help! Do I just have to replace the model download you mentioned in the original colab or do I have to additionally make those 3 changes you mentioned before?

Xinshuai-Lyu commented 1 year ago

@nikprt

Follow my previous guide and

!curl -L $(yadisk-direct https://disk.yandex.ru/d/ouP6l8VJ0HpMZg) -o big-lama.zip

The above link is broken, find this and replace it with:

!curl -LJO https://huggingface.co/smartywu/big-lama/resolve/main/big-lama.zip

Have tested it this morning and it works.

Hope it can help you. Enjoy :)

senya-ashukha commented 1 year ago

That is amazing! TY @Xinshuai-Lyu