question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

List Index Out of Range

See original GitHub issue

I tried two images. Both very old, one with lots of scratches, the other with some. I got List Index Out of Range both times.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

2reactions
yeasir2148commented, Jan 22, 2022

Hi @yeasir2148 Can you please provide more details about what you tried? It’ll be great if you could mention the steps to reproduce, the environment, and the setup in which you ran the model. Thanks.

Hi @noobyogi0010 ,

Thanks for replying. Here are the steps:

Upon submitting, on the right hand side of the page, you get the Output section, where on step/stage 4, I get the error List index out of range Screenshot from 2022-01-22 14-37-32

Iniput image: Untitled-4

0reactions
Rumlinvcommented, Dec 4, 2022

Does not work “GPU -1”

python run.py --input_folder /home/alex/Bringing-Old-Photos-Back-to-Life/test_images/old_w_scratch/ --output_folder /home/alex/Bringing-Old-Photos-Back-to-Life --GPU -1 Running Stage 1: Overall restoration test.py:19: DeprecationWarning: BILINEAR is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BILINEAR instead. def data_transforms(img, method=Image.BILINEAR, scale=False): Traceback (most recent call last): File “test.py”, line 98, in <module> model.initialize(opt) File “/home/alex/Bringing-Old-Photos-Back-to-Life/Global/models/mapping_model.py”, line 136, in initialize self.netG_A.cuda(opt.gpu_ids[0]) IndexError: list index out of range Finish Stage 1 …

Running Stage 2: Face Detection Finish Stage 2 …

Running Stage 3: Face Enhancement The main GPU is Traceback (most recent call last): File “test_face.py”, line 13, in <module> opt = TestOptions().parse() File “/home/alex/Bringing-Old-Photos-Back-to-Life/Face_Enhancement/options/base_options.py”, line 285, in parse print(opt.gpu_ids[0]) IndexError: list index out of range Finish Stage 3 …

Running Stage 4: Blending Finish Stage 4 …

All the processing is done. Please check the results.

Read more comments on GitHub >

github_iconTop Results From Across the Web

List Index Out of Range – Python Error Message Solved
You'll get the Indexerror: list index out of range error when iterating through a list and trying to access an item that doesn't...
Read more >
Python IndexError: List Index Out of Range Error Explained
In this tutorial, you'll learn how all about the Python list index out of range error, including what it is, why it occurs,...
Read more >
Indexerror: list Index Out of Range in Python - STechies
“List index out of range” error occurs in Python when we try to access an undefined element from the list. The only way...
Read more >
Python IndexError: List Index Out of Range [Easy Fix] - Finxter
The error “list index out of range” arises if you access invalid indices in your Python list. For example, if you try to...
Read more >
Index Error: list index out of range (Python) - Stack Overflow
Generally it means that you are providing an index for which a list element does not exist. E.g, if your list was [1,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found