YanjieZe / GNFactor

[CoRL 2023 Oral] GNFactor: Multi-Task Real Robot Learning with Generalizable Neural Feature Fields
https://yanjieze.com/GNFactor/
MIT License
119 stars 10 forks source link

`No module named 'ldm'` error occurs in `scripts/eval.sh` #3

Closed TMats closed 10 months ago

TMats commented 10 months ago

Thank you very much for making the codebase public!

I tried to evaluate public checkpoints following README, and I encountered the error below.

➜  workspace bash scripts/eval.sh GNFACTOR_BC released
[2023-12-27 11:06:50,025][root][INFO] - Using env device cuda:0.
[2023-12-27 11:06:50,073][root][INFO] - Evaluating seed 0.
Traceback (most recent call last):
  File "/root/workspace/GNFactor/eval.py", line 260, in <module>
    main()
  File "/root/.pyenv/versions/3.9.18/lib/python3.9/site-packages/hydra/main.py", line 32, in decorated_main
    _run_hydra(
  File "/root/.pyenv/versions/3.9.18/lib/python3.9/site-packages/hydra/_internal/utils.py", line 346, in _run_hydra
    run_and_report(
  File "/root/.pyenv/versions/3.9.18/lib/python3.9/site-packages/hydra/_internal/utils.py", line 201, in run_and_report
    raise ex
  File "/root/.pyenv/versions/3.9.18/lib/python3.9/site-packages/hydra/_internal/utils.py", line 198, in run_and_report
    return func()
  File "/root/.pyenv/versions/3.9.18/lib/python3.9/site-packages/hydra/_internal/utils.py", line 347, in <lambda>
    lambda: hydra.run(
  File "/root/.pyenv/versions/3.9.18/lib/python3.9/site-packages/hydra/_internal/hydra.py", line 107, in run
    return run_job(
  File "/root/.pyenv/versions/3.9.18/lib/python3.9/site-packages/hydra/core/utils.py", line 128, in run_job
    ret.return_value = task_function(task_cfg)
  File "/root/workspace/GNFactor/eval.py", line 250, in main
    eval_seed(train_cfg,
  File "/root/workspace/GNFactor/eval.py", line 47, in eval_seed
    from agents import gnfactor_bc
  File "/root/workspace/GNFactor/agents/gnfactor_bc/__init__.py", line 1, in <module>
    import agents.gnfactor_bc.launch_utils
  File "/root/workspace/GNFactor/agents/gnfactor_bc/launch_utils.py", line 23, in <module>
    from agents.gnfactor_bc.qattention_gnfactor_bc_agent import QAttentionPerActBCAgent
  File "/root/workspace/GNFactor/agents/gnfactor_bc/qattention_gnfactor_bc_agent.py", line 22, in <module>
    from agents.gnfactor_bc.neural_rendering import NeuralRenderer
  File "/root/workspace/GNFactor/agents/gnfactor_bc/neural_rendering.py", line 11, in <module>
    from agents.gnfactor_bc.models_embed import GeneralizableNeRFEmbedNet
  File "/root/workspace/GNFactor/agents/gnfactor_bc/models_embed.py", line 6, in <module>
    from agents.gnfactor_bc.resnetfc import ResnetFC
  File "/root/workspace/GNFactor/agents/gnfactor_bc/resnetfc.py", line 8, in <module>
    from .attention import Visual3DLangTransformer
  File "/root/workspace/GNFactor/agents/gnfactor_bc/attention.py", line 12, in <module>
    from ldm.modules.diffusionmodules.util import checkpoint
ModuleNotFoundError: No module named 'ldm'

This error is happened here, https://github.com/YanjieZe/GNFactor/blob/ec3fcaff44d356a75b0f599ec2570b1fbba11289/GNFactor/agents/gnfactor_bc/attention.py#L12

I think this line is to load checkpoints using utils of latent-diffusion

Do we also need to install latent-diffusion, which is not instructed in INSTALL.md?

Thanks in advance,

YanjieZe commented 10 months ago

Yes, could you try this? pip install stable-diffusion-sdkit==2.1.3

TMats commented 10 months ago

Thanks! It worked! PS: I'm creating a docker environment for GNFactor. https://github.com/TMats/GNFactor/tree/feature/docker/docker