SUDO-AI-3D / zero123plus

Code repository for Zero123++: a Single Image to Consistent Multi-view Diffusion Base Model.
Apache License 2.0
1.71k stars 118 forks source link

PytorchStreamReader failed reading zip archive: failed finding central directory #1

Closed Shiyao-Huang closed 11 months ago

Shiyao-Huang commented 11 months ago

when I run app.py


Collecting usage statistics. To deactivate, set browser.gatherUsageStats to False.

  You can now view your Streamlit app in your browser.

  Network URL: http://10.119.70.148:8501
  External URL: http://144.48.107.18:8501

2023-10-24 13:47:51.466322: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: SSE4.1 SSE4.2 AVX AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
text_encoder/model.safetensors not found
Loading pipeline components...: 100%|███████████████████████████████| 8/8 [00:03<00:00,  2.25it/s]
2023-10-24 13:48:09.295 Uncaught app exception
Traceback (most recent call last):
onda3/envs/train_sd/lib/python3.11/site-packages/streamlit/runtime/caching/cache_utils.py", line 245, in _get_or_create_cached_value
    cached_result = cache.read_result(value_key)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "aconda3/envs/train_sd/lib/python3.11/site-packages/streamlit/runtime/caching/cache_resource_api.py", line 447, in read_result
    raise CacheKeyNotFoundError()
streamlit.runtime.caching.cache_errors.CacheKeyNotFoundError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/homaconda3/envs/train_sd/lib/python3.11/site-packages/streamlit/runtime/caching/cache_utils.py", line 293, in _handle_cache_miss
    cached_result = cache.read_result(value_key)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/homeanaconda3/envs/train_sd/lib/python3.11/site-packages/streamlit/runtime/caching/cache_resource_api.py", line 447, in read_result
    raise CacheKeyNotFoundError()
streamlit.runtime.caching.cache_errors.CacheKeyNotFoundError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home//anaconda3/envs/train_sd/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)
  File "/home//download/zero123plus/app.py", line 206, in <module>
    SAMAPI.get_instance()
  File "/home//anaconda3/envs/train_sd/lib/python3.11/site-packages/streamlit/runtime/caching/cache_utils.py", line 194, in wrapper
    return cached_func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home//anaconda3/envs/train_sd/lib/python3.11/site-packages/streamlit/runtime/caching/cache_utils.py", line 223, in __call__
    return self._get_or_create_cached_value(args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home//anaconda3/envs/train_sd/lib/python3.11/site-packages/streamlit/runtime/caching/cache_utils.py", line 248, in _get_or_create_cached_value
    return self._handle_cache_miss(cache, value_key, func_args, func_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home//anaconda3/envs/train_sd/lib/python3.11/site-packages/streamlit/runtime/caching/cache_utils.py", line 302, in _handle_cache_miss
    computed_value = self._info.func(*func_args, **func_kwargs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home//download/zero123plus/app.py", line 41, in get_instance
    sam = sam_model_registry[model_type](checkpoint=sam_checkpoint)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home//anaconda3/envs/train_sd/lib/python3.11/site-packages/segment_anything/build_sam.py", line 15, in build_sam_vit_h
    return _build_sam(
           ^^^^^^^^^^^
  File "/home//anaconda3/envs/train_sd/lib/python3.11/site-packages/segment_anything/build_sam.py", line 105, in _build_sam
    state_dict = torch.load(f)
                 ^^^^^^^^^^^^^
  File "/home//anaconda3/envs/train_sd/lib/python3.11/site-packages/torch/serialization.py", line 797, in load
    with _open_zipfile_reader(opened_file) as opened_zipfile:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home//anaconda3/envs/train_sd/lib/python3.11/site-packages/torch/serialization.py", line 283, in __init__
    super().__init__(torch._C.PyTorchFileReader(name_or_buffer))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory
Colin97 commented 11 months ago

Can you double check that the checkpoint has been completely downloaded?

eliphatfs commented 11 months ago

The SAM checkpoint did not download completely. Note that it is 2.4GB, larger than 32 bit int, so some downloaders e.g. 32 bit wget would truncate the result. This also happens if you are using our script but have internet issues.

eliphatfs commented 11 months ago

Closing for now due to lack of activity. If you are still meeting the same problem, add more comments or open another issue. Thank you.