Algolzw / image-restoration-sde

Image Restoration with Mean-Reverting Stochastic Differential Equations, ICML 2023. Winning solution of the NTIRE 2023 Image Shadow Removal Challenge.
https://algolzw.github.io/ir-sde/index.html
MIT License
577 stars 42 forks source link

IndexError: list index out of range #33

Open AIisCool opened 1 year ago

AIisCool commented 1 year ago
/c/image-restoration-sde-main/codes/config/denoising-sde
$ python test.py -opt=options/test/ir-sde.yml
export CUDA_VISIBLE_DEVICES=0
Traceback (most recent call last):
  File "C:\image-restoration-sde-main\codes\config\denoising-sde\test.py", line 25, in <module>
    opt = option.parse(parser.parse_args().opt, is_train=False)
  File "C:\image-restoration-sde-main\codes\config\denoising-sde\options.py", line 60, in parse
    config_dir = path.split("/")[-2]
IndexError: list index out of range

How can I fix this? Thanks

Algolzw commented 1 year ago

Hi, if you use Windows you may need to replace the "/" with "\" in the options.py, line 60: https://github.com/Algolzw/image-restoration-sde/blob/94664978d948c7bc632db41045227e6c0f3ffa48/codes/config/denoising-sde/options.py#L60

AIisCool commented 1 year ago

Yes I'm on Windows 10 and I tried changing it but:

/c/image-restoration-sde-main/codes/config/denoising-sde
$ python test.py -opt=options/test/ir-sde.yml
Traceback (most recent call last):
  File "C:\image-restoration-sde-main\codes\config\denoising-sde\test.py", line 14, in <module>
    import options as option
  File "C:\image-restoration-sde-main\codes\config\denoising-sde\options.py", line 60
    config_dir = path.split("\")[-2]
                            ^
SyntaxError: unterminated string literal (detected at line 60)
Algolzw commented 1 year ago

Can you print the path and find the correct split symbol?

AIisCool commented 1 year ago

Not sure how to do that?

Algolzw commented 1 year ago

Hi you can just add one line print(path) to the options.py file before line 60.