InternLandMark / LandMark

Other
441 stars 39 forks source link

Possibly incorrect import path for `app` #25

Closed roastduck closed 10 months ago

roastduck commented 11 months ago

Hi team,

I am trying to run the example training script for MatrixCity by:

python app/trainer.py --config confs/matrixcity/matrixcity_2block_multi.txt

It reports the following error:

Traceback (most recent call last):
  File "/home/rd/src/LandMark_experiments/LandMark/app/trainer.py", line 11, in <module>
    from tools.render_utils import evaluation, evaluation_static, renderer_fn
  File "/home/rd/src/LandMark_experiments/LandMark/app/tools/render_utils.py", line 7, in <module>
    from models import *  # noqa: F401, F403 # pylint: disable=W0611,W0401,W0614
  File "/home/rd/src/LandMark_experiments/LandMark/app/models/__init__.py", line 1, in <module>
    from .gridnerf_branch_parallel import GridNeRFBranchParallel
  File "/home/rd/src/LandMark_experiments/LandMark/app/models/gridnerf_branch_parallel.py", line 12, in <module>
    from .gridnerf_parallel import GridBaseParallel
  File "/home/rd/src/LandMark_experiments/LandMark/app/models/gridnerf_parallel.py", line 10, in <module>
    from app.tools.dataloader.ray_utils import sample_pdf
ModuleNotFoundError: No module named 'app'

Apparently app should not be the name of a installed package. Running with PYTHONPATH=.:$PYTHONPATH works around the problem, but maybe app should be imported by .app or from other reliable paths.

martin416 commented 11 months ago

同样的问题

Saaaaln commented 11 months ago

Thanks for your suggestion. Our current approach is to introduce the following environment variables:

export PYTHONPATH=$YOUR_DIR/landmark/app:$PYTHONPATH

adamantboy commented 11 months ago

Thanks for your suggestion. Our current approach is to introduce the following environment variables:

export PYTHONPATH=$YOUR_DIR/landmark/app:$PYTHONPATH @roastduck @martin416 export PYTHONPATH=$YOUR_DIR/landmark/:$PYTHONPATH