-
Notifications
You must be signed in to change notification settings - Fork 298
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
cannot import name 'RandomBatchGeoSampler' from 'torchgeo.samplers.batch' #276
Comments
I cannot reproduce this issue on |
This is due to a circular dependency. Importing In your case, I guess it worked the second time because by then the datasets submodule was already imported by the previous failed call. |
@RitwikGupta thanks for the bug report, and @ashnair1 thanks for figuring out which commit fixed this. We'll likely release a 0.1.1 or 0.2.0 release in the next week that should resolve this. |
I'm actually thinking about removing the imports in
This issue arose when we decided to move all of our datamodules to
I'm fine with being disruptive (TorchGeo is still in alpha, we can afford to make backwards incompatible changes), but I want to make sure we have a good design first. Our goal here is to organize the library such that each directory within |
The original issue reported in this issue (circular import errors) has been fixed in the new 0.1.1 release, so I'll close this PR. I do still want to think about ways to speed up imports, but that can happen later. |
On
torchgeo==0.1.0
, the importfrom torchgeo.samplers import GeoSampler
fails with anImportError
. Interestingly, re-running the same import immediately after succeeds.The text was updated successfully, but these errors were encountered: