Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrupted model.pth.tar-6 #2

Open
xwjabc opened this issue Sep 1, 2022 · 2 comments
Open

Corrupted model.pth.tar-6 #2

xwjabc opened this issue Sep 1, 2022 · 2 comments

Comments

@xwjabc
Copy link

xwjabc commented Sep 1, 2022

Thank you for your great work! I tried to generate the category embedding using the provided checkpoint promptdet_resources/prompt_learner/lvis/model.pth.tar-6 in the following command

# stage-I: generate the category embeddings
python tools/promptdet/gen_category_embedding.py --model-file promptdet_resources/prompt_learner/lvis/model.pth.tar-6 --name-file promptdet_resources/lvis_category_and_description.txt --out-file promptdet_resources/reproduce_lvis_category_embeddings.pt

However, it shows error RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

The same error also occurs when I directly load the checkpoint file using torch.load():

>>> import torch
>>> x = torch.load("promptdet_resources/prompt_learner/lvis/model.pth.tar-6")

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/weijianxu/anaconda3/envs/dassl/lib/python3.8/site-packages/torch/serialization.py", line 705, in load
    with _open_zipfile_reader(opened_file) as opened_zipfile:
  File "/home/weijianxu/anaconda3/envs/dassl/lib/python3.8/site-packages/torch/serialization.py", line 242, in __init__
    super(_open_zipfile_reader, self).__init__(torch._C.PyTorchFileReader(name_or_buffer))
RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

Based on the above observations, I think the error probably comes from the corrupted model.pth.tar-6 file. My PyTorch version is 1.12.1 but I also tried PyTorch 1.9.0 and got the same error message. Thus, I wonder if the authors could check the completeness of the checkpoint and may provide an updated version. Thanks!

@fcjian
Copy link
Owner

fcjian commented Sep 4, 2022

Thank you for your correction, and now we uploaded an updated version.

@xwjabc
Copy link
Author

xwjabc commented Sep 5, 2022

@fcjian Thank you for your quick reply! Will try the updated checkpoint.

In addition, would you mind providing the script to generate lvis_manual_category_embeddings.pt? I would like to compare the difference between these predefined embeddings with the learnable one from PromptDet. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants