-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
Description: I am encountering an ImportError while attempting to import NonGeoDataset from torchgeo.datasets.geo module in the satclip codebase. This issue arises when executing the load.py script, specifically when attempting to import NonGeoDataset in the s2geo_dataset.py file.
Steps to Reproduce:
- Clone the satclip codebase.
- Navigate to the
satclipdirectory. - Execute the
load.pyscript.
Expected Behavior: The load.py script should execute without errors and successfully import NonGeoDataset from torchgeo.datasets.geo module.
Actual Behavior: The following ImportError occurs:
import sys
sys.path.append("./satclip")
from load import get_satclip---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
/tmp/ipykernel_290/977908425.py in <module>
1 import sys
2 sys.path.append("./satclip")
----> 3 from load import get_satclip
/mnt/satclip/satclip/load.py in <module>
----> 1 from main import *
2
3 def get_satclip(ckpt_path, device, return_all=False):
4 ckpt = torch.load(ckpt_path,map_location=device)
5 ckpt['hyper_parameters'].pop('eval_downstream')
/mnt/satclip/satclip/main.py in <module>
5 import lightning.pytorch
6 import torch
----> 7 from datamodules.s2geo_dataset import S2GeoDataModule
8 from lightning.pytorch.callbacks import ModelCheckpoint
9 from lightning.pytorch.cli import LightningCLI
/mnt/satclip/satclip/datamodules/__init__.py in <module>
1 from .transforms import *
----> 2 from .s2geo_dataset import *
/mnt/satclip/satclip/datamodules/s2geo_dataset.py in <module>
5 import rasterio
6 from torch import Tensor
----> 7 from torchgeo.datasets.geo import NonGeoDataset
8 import matplotlib.pyplot as plt
9 import numpy as np
ImportError: cannot import name 'NonGeoDataset' from 'torchgeo.datasets.geo' (/opt/conda/lib/python3.8/site-packages/torchgeo/datasets/geo.py)Environment:
- Operating System: Linux
- Python Version: 3.8
- Dependencies:
- lightning==2.2.2
- rasterio==1.3.10
- torchgeo==0.4.1
- torch==2.2.1
Additional Information:
- I have confirmed that the
torchgeolibrary is installed correctly. - I am using the latest version of the satclip codebase from the main branch.
- I have checked the
torchgeodocumentation and source code, but I couldn't find any references toNonGeoDatasetwithin thetorchgeo.datasets.geomodule.
Please let me know if there are any additional steps I can take to troubleshoot this issue or if there is any further information needed to assist with resolving this problem. Thank you.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels