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

Getting "B1" is not in list error with 0.4.0 release for Landsat8 dataset #1134

Closed
TolgaAktas opened this issue Feb 22, 2023 · 2 comments · Fixed by #1135
Closed

Getting "B1" is not in list error with 0.4.0 release for Landsat8 dataset #1134

TolgaAktas opened this issue Feb 22, 2023 · 2 comments · Fixed by #1135
Assignees
Labels
datasets Geospatial or benchmark datasets
Milestone

Comments

@TolgaAktas
Copy link

TolgaAktas commented Feb 22, 2023

Issue

Previously, the following instantiation used to work with 0.3.1 version:

dataset = Landsat8(root=root_path,bands=["B1","B2","B3","B4","B5","B6","B7","B8","B9","B10", "B11","QA_PIXEL"])

But with 0.4.0, I am getting the following error stack:

Traceback (most recent call last):
  File "/home/ta6167/diffusion_experiments/improved_ddpm_experiments/main.py", line 14, in <module>
    dataset = Landsat8(root=root_path,bands=["B1","B2","B3","B4","B5","B6","B7","B8","B9","B10", "B11","QA_PIXEL"])
  File "/home/ta6167/.local/lib/python3.10/site-packages/torchgeo/datasets/landsat.py", line 80, in __init__
    super().__init__(root, crs, res, bands, transforms, cache)
  File "/home/ta6167/.local/lib/python3.10/site-packages/torchgeo/datasets/geo.py", line 371, in __init__
    band_indexes = [self.all_bands.index(i) + 1 for i in bands]
  File "/home/ta6167/.local/lib/python3.10/site-packages/torchgeo/datasets/geo.py", line 371, in <listcomp>
    band_indexes = [self.all_bands.index(i) + 1 for i in bands]
ValueError: 'B1' is not in list

I am guessing the designation for channel names might have changed, what is the correct way to provide the channel names for 0.4.0 version?

Fix

No response

@TolgaAktas TolgaAktas added the documentation Improvements or additions to documentation label Feb 22, 2023
@adamjstewart adamjstewart added this to the 0.4.1 milestone Feb 22, 2023
@adamjstewart adamjstewart added datasets Geospatial or benchmark datasets and removed documentation Improvements or additions to documentation labels Feb 22, 2023
@adamjstewart
Copy link
Collaborator

Thanks for reporting this bug! This appears to be an unintended consequence of @ashnair1's #687. Let me see if I can come up with a bug fix and we'll fix this in the 0.4.1 release (due in 1–2 weeks).

@adamjstewart
Copy link
Collaborator

Should be fixed in #1135!

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

Successfully merging a pull request may close this issue.

2 participants