Deforum_Stable_Diffusionやってると, RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory
とか言われることがあって,その際の対処方法のメモです.エラー内容は↓.
reading custom settings from /content/drive/MyDrive/Settings.txt
The custom settings file does not exist. The in-notebook settings will be used instead
Saving animation frames to /content/drive/MyDrive/AI/StableDiffusion/2022-12/StableFun
Loading base model ()...Using cache found in /root/.cache/torch/hub/rwightman_gen-efficientnet-pytorch_master
Done.
Removing last two layers (global_pool & classifier).
Building Encoder-Decoder model..Done.
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
<ipython-input-12-9425e8efad93> in <module>
548 # dispatch to appropriate renderer
549 if anim_args.animation_mode == '2D' or anim_args.animation_mode == '3D':
--> 550 render_animation(args, anim_args)
551 elif anim_args.animation_mode == 'Video Input':
552 render_input_video(args, anim_args)
5 frames
/usr/local/lib/python3.8/dist-packages/torch/serialization.py in __init__(self, name_or_buffer)
240 class _open_zipfile_reader(_opener):
241 def __init__(self, name_or_buffer) -> None:
--> 242 super(_open_zipfile_reader, self).__init__(torch._C.PyTorchFileReader(name_or_buffer))
243
244
RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory
解決方法
自分の場合は色々試したあげるく,Google colabのファイルを作り直すことで解決しました.
Pytorchの何かしらのzipファイルを読み込む失敗のエラーだと思うので,dpt_large-midas-2f21e586.pt
を手動でとってきたり色々試しり,StackOverflowに書かれていたように,ドライブにあるAIフォルダを削除するも試したのですが,すべてダメで,Colabファイル作り直すのが良いと思います.