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
PytorchStreamReader failed reading zip archive: failed finding central directory (no backtrace available) #31620
Comments
Can you please provide a minimum script demonstrating the error? |
The attached file does not seem to be a valid TorchScript file (i.e. one generated with |
this model file comes from the script to generate the file : Thanks. |
I try to load the attached model file in this way. |
The You will need to make your model compatible with TorchScript (either via tracing or scripting, details here), then save that via |
Ok, It works for me, thank you. |
Summary: This adds a check to catch the case where someone `torch.save`s something then `torch::jit::load`s it in C++. Relevant for #31620 ](https://our.intern.facebook.com/intern/diff/19252172/) Pull Request resolved: #31709 Pulled By: driazati Differential Revision: D19252172 fbshipit-source-id: f2a9b4442647285418b2778306629b4ff77c15e5
Summary: This adds a check to catch the case where someone `torch.save`s something then `torch::jit::load`s it in C++. Relevant for pytorch#31620 ](https://our.intern.facebook.com/intern/diff/19252172/) Pull Request resolved: pytorch#31709 Pulled By: driazati Differential Revision: D19252172 fbshipit-source-id: f2a9b4442647285418b2778306629b4ff77c15e5
@kuloud Can you please share the code with scripting. |
I faced this issue and my problem was that, the pretrained model I used, had saved the model wholesomely ( saved it like to solve this, I simply first saved the models state_dict() into a new checkpoint file, loaded from the new checkpoint and then converted my model. |
In my case, this error was caused by a corrupted saved file. So I switch to older checkpoints and the problem is gone. |
I am running this and it is showing me this error:
|
I had the same problem today. In my case, it was because of corrupted download files. Somehow it stops downloading and goes to the next process which is unzipping. There the problem occurs. There must be hash control or something else for downloads and I think an exception should be raised. |
@bekirbakar Did you manage to fix this? I am running into the same issue. |
Problem was my server's internet speed (maybe not speed but stability). I downloaded files with a good connection using another device. And then I transferred them to the server via external hardware. I suggest you check your ethernet or wifi. Or of course, you can do what I did. Basically, the code tries to extract/unzip corrupted files. |
/// same error import torch RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory can any one help me |
Download model manually and load it from local. See this post. |
I run into this issue when different processes on different GPU ranks want to load the same file using |
By the way, it would be nice if we can get the error message shows the name of the file and the rank that cannot load the checkpoint! |
I have faced the same problem. |
🐛 Bug
To Reproduce
Steps to reproduce the behavior:
2.PytorchStreamReader failed reading zip archive
Expected behavior
Load the model file correct.
Environment
Additional context
onet_epoch.pt.zip
cc @suo
The text was updated successfully, but these errors were encountered: