kylesargent / ZeroNVS

Apache License 2.0
478 stars 31 forks source link

ModuleNotFoundError: No module named 'ldm' #22

Closed silky1708 closed 5 months ago

silky1708 commented 5 months ago

On running launch_inference.sh, I'm getting the following error:

Traceback (most recent call last):
  File "launch.py", line 254, in <module>
    main(args, extras)
  File "launch.py", line 83, in main
    import threestudio
  File "/ZeroNVS/threestudio/__init__.py", line 36, in <module>
    from . import data, models, systems
  File "/ZeroNVS/threestudio/models/__init__.py", line 1, in <module>
    from . import (
  File "/ZeroNVS/threestudio/models/guidance/__init__.py", line 1, in <module>
    from . import (
  File "/ZeroNVS/threestudio/models/guidance/zero123_guidance.py", line 21, in <module>
    from ldm.data import common
ModuleNotFoundError: No module named 'ldm'
silky1708 commented 5 months ago

In the root directory ZeroNVS/, remove and clone the following repository from scratch:

rm -r zeronvs_diffusion
git clone https://github.com/kylesargent/zeronvs_diffusion.git

and add the following lines before importing ldm in ZeroNVS/threestudio/models/guidance/zero123_guidance.py:

import sys
sys.path.append("./zeronvs_diffusion/zero123/")
from ldm.data import common

This fixed the issue for me!