openai / shap-e

Generate 3D objects conditioned on text or images
MIT License
11.69k stars 951 forks source link

RuntimeError in sample_image_to_3d.ipnb #116

Closed danial880 closed 11 months ago

danial880 commented 1 year ago

It gives an error while loading image_cond.pt. Here is the traceback

Cell In[6], line 2
      1 xm = load_model('transmitter', device=device)
----> 2 model = load_model('image300M', device=device)
      3 diffusion = diffusion_from_config(load_config('diffusion'))

File ~/Desktop/shap-e/shap_e/models/download.py:147, in load_model(model_name, device, **kwargs)
    144 from .configs import model_from_config
    146 model = model_from_config(load_config(model_name, **kwargs), device=device)
--> 147 model.load_state_dict(load_checkpoint(model_name, device=device, **kwargs))
    148 model.eval()
    149 return model

File ~/Desktop/shap-e/shap_e/models/download.py:133, in load_checkpoint(checkpoint_name, device, progress, cache_dir, chunk_size)
    129 if checkpoint_name not in MODEL_PATHS:
    130     raise ValueError(
    131         f"Unknown checkpoint name {checkpoint_name}. Known names are: {MODEL_PATHS.keys()}."
    132     )
--> 133 path = fetch_file_cached(
    134     MODEL_PATHS[checkpoint_name], progress=progress, cache_dir=cache_dir, chunk_size=chunk_size
    135 )
    136 return torch.load(path, map_location=device)

File ~/Desktop/shap-e/shap_e/models/download.py:64, in fetch_file_cached(url, progress, cache_dir, chunk_size)
     62 local_path = os.path.join(cache_dir, url.split("/")[-1])
     63 if os.path.exists(local_path):
---> 64     check_hash(local_path, expected_hash)
     65     return local_path
     67 response = requests.get(url, stream=True)

File ~/Desktop/shap-e/shap_e/models/download.py:88, in check_hash(path, expected_hash)
     86 actual_hash = hash_file(path)
     87 if actual_hash != expected_hash:
---> 88     raise RuntimeError(
     89         f"The file {path} should have hash {expected_hash} but has {actual_hash}. "
     90         "Try deleting it and running this call again."
     91     )

RuntimeError: The file /home/danial/Desktop/shap-e/shap_e/examples/shap_e_model_cache/image_cond.pt should have hash cb8072c64bbbcf6910488814d212227de5db291780d4ea99c6152f9346cf12aa but has 516d61c070cf47738791397c2fd9fd998fd7f140859c22f7e504d2ec089cc22e. Try deleting it and running this call again.

I have tried deleting and running it again but still same error.

ribeiromarilene commented 10 months ago

Comments danial880 commented on Nov 11, 2023 It gives an error while loading image_cond.pt. Here is the traceback

Cell In[6], line 2 1 xm = load_model('transmitter', device=device) ----> 2 model = load_model('image300M', device=device) 3 diffusion = diffusion_from_config(load_config('diffusion'))

File ~/Desktop/shap-e/shap_e/models/download.py:147, in load_model(model_name, device, kwargs) 144 from .configs import model_from_config 146 model = model_from_config(load_config(model_name, kwargs), device=device) --> 147 model.load_state_dict(load_checkpoint(model_name, device=device, **kwargs)) 148 model.eval() 149 return model

File ~/Desktop/shap-e/shap_e/models/download.py:133, in load_checkpoint(checkpoint_name, device, progress, cache_dir, chunk_size) 129 if checkpoint_name not in MODEL_PATHS: 130 raise ValueError( 131 f"Unknown checkpoint name {checkpoint_name}. Known names are: {MODEL_PATHS.keys()}." 132 ) --> 133 path = fetch_file_cached( 134 MODEL_PATHS[checkpoint_name], progress=progress, cache_dir=cache_dir, chunk_size=chunk_size 135 ) 136 return torch.load(path, map_location=device)

File ~/Desktop/shap-e/shap_e/models/download.py:64, in fetch_file_cached(url, progress, cache_dir, chunk_size) 62 local_path = os.path.join(cache_dir, url.split("/")[-1]) 63 if os.path.exists(local_path): ---> 64 check_hash(local_path, expected_hash) 65 return local_path 67 response = requests.get(url, stream=True)

File ~/Desktop/shap-e/shap_e/models/download.py:88, in check_hash(path, expected_hash) 86 actual_hash = hash_file(path) 87 if actual_hash != expected_hash: ---> 88 raise RuntimeError( 89 f"The file {path} should have hash {expected_hash} but has {actual_hash}. " 90 "Try deleting it and running this call again." 91 )

RuntimeError: The file /home/danial/Desktop

ribeiromarilene commented 10 months ago

Comments danial880 commented on Nov 11, 2023 It gives an error while loading image_cond.pt. Here is the traceback

Cell In[6], line 2 1 xm = load_model('transmitter', device=device) ----> 2 model = load_model('image300M', device=device) 3 diffusion = diffusion_from_config(load_config('diffusion'))

File ~/Desktop/shap-e/shap_e/models/download.py:147, in load_model(model_name, device, kwargs) 144 from .configs import model_from_config 146 model = model_from_config(load_config(model_name, kwargs), device=device) --> 147 model.load_state_dict(load_checkpoint(model_name, device=device, **kwargs)) 148 model.eval() 149 return model

File ~/Desktop/shap-e/shap_e/models/download.py:133, in load_checkpoint(checkpoint_name, device, progress, cache_dir, chunk_size) 129 if checkpoint_name not in MODEL_PATHS: 130 raise ValueError( 131 f"Unknown checkpoint name {checkpoint_name}. Known names are: {MODEL_PATHS.keys()}." 132 ) --> 133 path = fetch_file_cached( 134 MODEL_PATHS[checkpoint_name], progress=progress, cache_dir=cache_dir, chunk_size=chunk_size 135 ) 136 return torch.load(path, map_location=device)

File ~/Desktop/shap-e/shap_e/models/download.py:64, in fetch_file_cached(url, progress, cache_dir, chunk_size) 62 local_path = os.path.join(cache_dir, url.split("/")[-1]) 63 if os.path.exists(local_path): ---> 64 check_hash(local_path, expected_hash) 65 return local_path 67 response = requests.get(url, stream=True)

File ~/Desktop/shap-e/shap_e/models/download.py:88, in check_hash(path, expected_hash) 86 actual_hash = hash_file(path) 87 if actual_hash != expected_hash: ---> 88 raise RuntimeError( 89 f"The file {path} should have hash {expected_hash} but has {actual_hash}. " 90 "Try deleting it and running this call again." 91 )

RuntimeError: The file /home/danial/Desktop