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

Index Error #11

Closed
s86707 opened this issue Jul 31, 2023 · 6 comments
Closed

Index Error #11

s86707 opened this issue Jul 31, 2023 · 6 comments
Labels
question Further information is requested

Comments

@s86707
Copy link

s86707 commented Jul 31, 2023

Hi, I'm using my own Input-Data and I'm becoming the: Index Error: list out of range.

Here is the full issue:

Traceback (most recent call last):
File "dsen2cr_main.py", line 179, in
run_dsen2cr(args.predict_file, args.resume_file)
File "dsen2cr_main.py", line 160, in run_dsen2cr
max_val_sar, scale)
File "C:\Users\maria\Documents\GitHub\dsen2-cr\Code\dsen2cr_tools.py", line 169, in predict_dsen2cr
for i, (data, y) in enumerate(predict_generator):
File "C:\Users\maria\anaconda3\envs\dsen2cr\lib\site-packages\keras\utils\data_utils.py", line 372, in iter
for item in (self[i] for i in range(len(self))):
File "C:\Users\maria\anaconda3\envs\dsen2cr\lib\site-packages\keras\utils\data_utils.py", line 372, in
for item in (self[i] for i in range(len(self))):
File "C:\Users\maria\Documents\GitHub\dsen2-cr\Code\tools\dataIO.py", line 280, in getitem
self.random_crop_paramy[indexes])
File "C:\Users\maria\Documents\GitHub\dsen2-cr\Code\tools\dataIO.py", line 308, in __data_generation
random_crop_paramy_temp, data_type=3)
File "C:\Users\maria\Documents\GitHub\dsen2-cr\Code\tools\dataIO.py", line 407, in get_batch
data_image = self.get_data_image(ID, data_type, random_crop_paramx_temp[i], random_crop_paramy_temp[i])
File "C:\Users\maria\Documents\GitHub\dsen2-cr\Code\tools\dataIO.py", line 354, in get_data_image
data_path = os.path.join(self.input_data_folder, ID[data_type], ID[4]).lstrip()
IndexError: list index out of range

The output folder is also created but don't get any output images.
It wolud be very nice if someone could give me an advice for this error.

@ameraner
Copy link
Owner

ameraner commented Aug 1, 2023

Hi @s86707 , thank you for your issue. The error message points to an issue in your data .csv file (I assume that the list out-of-range error comes from the ID indexing). Are you sure that your csv file has the correct number of columns, as here https://github.com/ameraner/dsen2-cr/blob/main/Data/datasetfilelist.csv? You could also check that it is being read correctly by checking the outputs of this function:

return train_filelist, val_filelist, test_filelist

@s86707
Copy link
Author

s86707 commented Aug 2, 2023 via email

@ameraner
Copy link
Owner

ameraner commented Aug 3, 2023

Hi @s86707 , it's a different error, but it sounds similar to what has been reported here by @CatalinVulcan #10 (comment) - maybe also for you it's a numpy version issue?

@zhaotianle123
Copy link

I had the same problem as you, can I ask how you solved it in the end?

@ameraner
Copy link
Owner

@CatalinVulcan reported that by downgrading numpy he got a bit farther, but then had other incompatibility issues. If you ever get it running, feel free to open a PR or propose changes.

@ameraner
Copy link
Owner

I'm closing this issue since the original issue is solved, and the second issue is reported in #10

@ameraner ameraner added the question Further information is requested label Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants