OpenGVLab / DragGAN

Unofficial Implementation of DragGAN - "Drag Your GAN: Interactive Point-based Manipulation on the Generative Image Manifold" (DragGAN 全功能实现,在线Demo,本地部署试用,代码、模型已全部开源,支持Windows, macOS, Linux)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

win10 下报错:RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory

greatgeek opened this issue · comments

我是使用 conda 按照教程进行安装的,不过弹出了以下报错:
`(draggan) E:\PythonWorkspace\DragGAN-main>python gradio_app.py
D:\Anaconda3\envs\draggan\lib\site-packages\torch\utils\cpp_extension.py:365: UserWarning:

                           !! WARNING !!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Your compiler (cl 12.00.8168) may be ABI-incompatible with PyTorch!
Please use a compiler that is ABI-compatible with GCC 5.0 and above.
See https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html.

See https://gist.github.com/goldsborough/d466f43e8ffc948ff92de7486c5216d6
for instructions on how to install GCC 5 or higher.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

                          !! WARNING !!

warnings.warn(ABI_INCOMPATIBILITY_WARNING.format(compiler))
E:\PythonWorkspace\DragGAN-main\stylegan2\op\fused_act.py:23: UserWarning: (This is not error) Switch to native implementation
f"(This is not error) Switch to native implementation"
E:\PythonWorkspace\DragGAN-main\stylegan2\op\upfirdn2d.py:22: UserWarning: (This is not error) Switch to native implementation
f"(This is not error) Switch to native implementation"
Traceback (most recent call last):
File "gradio_app.py", line 346, in
demo = main()
File "gradio_app.py", line 241, in main
wrapped_model = ModelWrapper(ckpt=DEFAULT_CKPT, size=CKPT_SIZE[DEFAULT_CKPT])
File "gradio_app.py", line 78, in init
self.g_ema = stylegan2(**kwargs).to(device)
File "E:\PythonWorkspace\DragGAN-main\drag_gan.py", line 126, in stylegan2
checkpoint = torch.load(get_path(ckpt))
File "D:\Anaconda3\envs\draggan\lib\site-packages\torch\serialization.py", line 777, in load
with _open_zipfile_reader(opened_file) as opened_zipfile:
File "D:\Anaconda3\envs\draggan\lib\site-packages\torch\serialization.py", line 282, in init
super(_open_zipfile_reader, self).init(torch._C.PyTorchFileReader(name_or_buffer))
RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory`

(draggan) E:\PythonWorkspace\DragGAN-main>gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=d:/mingw/bin/../libexec/gcc/mingw32/9.2.0/lto-wrapper.exe Target: mingw32 Configured with: ../src/gcc-9.2.0/configure --build=x86_64-pc-linux-gnu --host=mingw32 --target=mingw32 --disable-win32-registry --with-arch=i586 --with-tune=generic --enable-static --enable-shared --enable-threads --enable-languages=c,c++,objc,obj-c++,fortran,ada --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --enable-libgomp --disable-libvtv --with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw --enable-libstdcxx-debug --disable-build-format-warnings --prefix=/mingw --with-gmp=/mingw --with-mpfr=/mingw --with-mpc=/mingw --with-isl=/mingw --enable-nls --with-pkgversion='MinGW.org GCC Build-20200227-1' Thread model: win32 gcc version 9.2.0 (MinGW.org GCC Build-20200227-1)

我的 gcc 版本也是满足要求的。

我知道是什么原因是,是因为模型下载不全导致的这个错误。
解决办法为:
https://huggingface.co/akhaliq/jojogan-stylegan2-ffhq-config-f/blob/main/stylegan2-ffhq-config-f.pt 到这里下载完整的模型,替换掉 C:\Users\hui\draggan\checkpoints\stylegan2-ffhq-config-f.pt 这个目录下的模型即可。