[go: up one dir, main page]

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

ModuleNotFoundError: No module named 'rastervision.examples' when running command from examples doc #2137

Closed
bnascimento opened this issue May 3, 2024 · 1 comment · Fixed by #2138

Comments

@bnascimento
Copy link
bnascimento commented May 3, 2024

🐛 Bug

I have build the docker and was running the docker via docker/run --gpu --tensorboard. I was following the documentation for the examples, but it failed with "ModuleNotFoundError: No module named 'rastervision.examples'" when I checked locally upon the following one liner:

(base) root@f8bc8ab0414a:/opt/src# rastervision run local rastervision.examples.chip_classification.spacenet_rio -a raw_uri $RAW_URI -a processed_uri $PROCESSED_URI -a root_uri $ROOT_URI -a test True --splits 2

To Reproduce

Steps to reproduce the behavior:

  1. build and run docker
    2.follow examples guide https://docs.rastervision.io/en/stable/framework/examples.html
(base) root@f8bc8ab0414a:/opt/src# rastervision run local rastervision.examples.chip_classification.spacenet_rio -a raw_uri $RAW_URI -a processed_uri $PROCESSED_URI -a root_uri $ROOT_URI -a test True --splits 2
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/opt/src/rastervision_pipeline/rastervision/pipeline/cli.py", line 250, in <module>
    _main()
  File "/opt/src/rastervision_pipeline/rastervision/pipeline/cli.py", line 246, in _main
    main()
  File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/src/rastervision_pipeline/rastervision/pipeline/cli.py", line 171, in run
    cfgs = get_configs(cfg_module, runner, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/src/rastervision_pipeline/rastervision/pipeline/cli.py", line 65, in get_configs
    cfg_module = importlib.import_module(cfg_module_path)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1126, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1126, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'rastervision.examples'

Expected behavior

Started to run the example

Environment

Running Raster Vision directly in Windows is not supported, and we recommend that you run it from within a Docker container.

  • How you installed and are running Raster Vision (pip install on local vs. inside Docker image): docker image
  • Raster Vision version or commit: v0.30.0
  • OS (e.g., Linux): ubuntu jammy
  • Python version: 3.11.6
  • CUDA/cuDNN version if running on GPU: Driver Version: 550.54.15 CUDA Version: 12.4
  • Any other relevant information:

Additional context

@AdeelH
Copy link
Collaborator
AdeelH commented May 3, 2024

Looks like that doc page hasn't been updated in a while. Thanks for reporting!

You will need to change

rastervision.examples.chip_classification.spacenet_rio

to

rastervision.pytorch_backend.examples.chip_classification.spacenet_rio

The example being referenced is located here.

@AdeelH AdeelH changed the title ModuleNotFoundError: No module named 'rastervision.examples ModuleNotFoundError: No module named 'rastervision.examples' when running command from examples doc May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants