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

Error when running iw3——“PytorchStreamReader failed reading zip archive: failed finding central directory” #73

Closed
yiyan32 opened this issue Jan 23, 2024 · 9 comments

Comments

@yiyan32
Copy link

yiyan32 commented Jan 23, 2024

image
Strictly follow the steps to Manually install(https://github.com/nagadomi/nunif/blob/master/INSTALL-windows.md. The waifu2x is running well.
However, when using iw3, whether it is converting pictures or videos, the same error will occur. The parameter settings are as shown above.

@nagadomi
Copy link
Owner

If waifu2x works, the iw3 model file may be corrupted due to download problems.
Try deleting iw3/pretrained_models/hub folder and try again.
The first run will download a 1GB+ file, so it may take a long time.

Also, CLI will provide more detailed error messages.

python -m iw3.cli -i input.jpg -o output.png

@yiyan32
Copy link
Author

yiyan32 commented Jan 24, 2024

I have downloaded all of the 3 depth models, still reporting an error. using the code you provided above for testing, the error details are as follows
b00e1fa652b9234ceb02c566b8987f5

thank you for your time

@nagadomi
Copy link
Owner

nagadomi commented Jan 24, 2024

The error is iw3/pretrained_models/hub/checkpoints/ZoeD_M12_N.pt file loading error.
Pytorch checkpoint file(model/weight/parameter file, .pt,.pth) is internally a zip archive, so the file format error seems to be such a message.

Possible causes are,

  1. File is corrupt
  2. File path problems (e.g., multibyte characters, read permissions)
  3. Python or PyTorch version compatibility (pickle version)

It's not likely to be 2 or 3, as waifu2x(loading other checkpoint files) is working.
Possible causes of file corruption,

  • Download Failure
  • Disk full
  • Modification by anti-virus software, etc.

Could you check the size and MD5 of iw3\pretrained_models\hub\checkpoints\ZoeD_M12_N.pt?

  1. check file size (on command prompt)
dir iw3\pretrained_models\hub\checkpoints

result

 Volume in drive C has no label.
 Volume Serial Number is EA34-A50B

 Directory of C:\dev\nunif\windows_package\nunif\iw3\pretrained_models\hub\checkpoints

09/27/2023  07:43 AM    <DIR>          .
09/27/2023  07:43 AM    <DIR>          ..
09/27/2023  07:43 AM     1,443,406,099 ZoeD_M12_N.pt
  1. check md5sum
certutil -hashfile iw3\pretrained_models\hub\checkpoints\ZoeD_M12_N.pt MD5

result

MD5 hash of iw3\pretrained_models\hub\checkpoints\ZoeD_M12_N.pt:
f9b240db5a30a1600e25cad6866516b7
CertUtil: -hashfile command completed successfully.

File size: 1,443,406,099
MD5: f9b240db5a30a1600e25cad6866516b7

same result on linux.

% ls -la iw3/pretrained_models/hub/checkpoints/ZoeD_M12_N.pt
-rw------- 1 nagadomi nagadomi 1443406099  7月 28 13:02 iw3/pretrained_models/hub/checkpoints/ZoeD_M12_N.pt
% md5sum iw3/pretrained_models/hub/checkpoints/ZoeD_M12_N.pt
f9b240db5a30a1600e25cad6866516b7  iw3/pretrained_models/hub/checkpoints/ZoeD_M12_N.pt

Those ZoeDepth model files are downloaded from https://github.com/isl-org/ZoeDepth/releases/tag/v1.0

@yiyan32
Copy link
Author

yiyan32 commented Jan 25, 2024

It is indeed an error caused by the damaged model. After manually downloading the corresponding model from Huggingface, it can run smoothly. Thank you for your patience and guidance!

@yiyan32 yiyan32 closed this as completed Jan 25, 2024
@nagadomi
Copy link
Owner

Do you have any idea why the file is damaged?

@nagadomi
Copy link
Owner

It seems that torch.hub.load stores the files first to the system's temporary folder.
Possibly there is not enough space there.

I will add file validation with the hash value.

@wangchuanzhang
Copy link

Why is only the CPU recognized here and not my GPU? The CPU can be used, but it's too slow.
屏幕截图 2024-01-26 043910
屏幕截图 2024-01-26 043911

@yiyan32
Copy link
Author

yiyan32 commented Jan 26, 2024

image
The above pic shows the model size and hash value that I downloaded automatically through the gui, while the system disk space is enough, it is very likely a network problem.

@nagadomi
Copy link
Owner

Thanks for the reply.
It seems that there are repeated download failures, so automatic download retries may not fix the problem.
However, I will try to clarify the error message.

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

3 participants