facebookresearch / ImageBind

ImageBind One Embedding Space to Bind Them All
Other
8.29k stars 760 forks source link

ModuleNotFoundError: No module named 'models' #36

Open heedongcho-xyz opened 1 year ago

heedongcho-xyz commented 1 year ago

I've been getting this error when trying out the model:


ModuleNotFoundError Traceback (most recent call last) in <cell line: 3>() 1 import data 2 import torch ----> 3 from models import imagebind_model 4 from models.imagebind_model import ModalityType 5

ModuleNotFoundError: No module named 'models'


NOTE: If your import is failing due to a missing package, you can manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the "Open Examples" button below.

problem

XinyueZ commented 1 year ago

try this


libs = [
    "pytorchvideo@git+https://github.com/facebookresearch/pytorchvideo.git@28fe037d212663c6a24f373b94cc5d478c8c1a1d",
    "timm",
    "ftfy",
    "regex",
    "einops",
    "fvcore",
    "decord"
]

for lib in libs:
    command = f"pip install {lib}"
    os.system(command)

os.system("wget -nc -P models https://dl.fbaipublicfiles.com/imagebind/imagebind_huge.pth")
model_path = "./models/imagebind_huge.pth"
os.system("git clone https://github.com/facebookresearch/ImageBind.git")
sys.path.append('/content/ImageBind')
sys.path.append('/content/ImageBind/models')
XinyueZ commented 1 year ago

also suggest team to do this https://github.com/facebookresearch/ImageBind/issues/35

heedongcho-xyz commented 1 year ago

Thanks a lot. It seems to get stuck here somehow cause2 problem2

XinyueZ commented 1 year ago

I think you should "restart runtime" and then continue. NOT "disconnect runtime".

heedongcho-xyz commented 1 year ago

Hmmm, I still get the same error...