TencentARC / VQFR

ECCV 2022, Oral, VQFR: Blind Face Restoration with Vector-Quantized Dictionary and Parallel Decoder
https://ycgu.site/projects/vqfr
Other
324 stars 42 forks source link

Issue with runing demo on V1 model #18

Closed vlp47226 closed 1 year ago

vlp47226 commented 1 year ago

Hello,

I have been successful in running the demo file with the VQFR V2, however, V1 returns an error:

Traceback (most recent call last): File "demo.py", line 161, in <module> main() File "demo.py", line 103, in main restorer = VQFR_Demo(model_path=model_path, upscale=args.upscale, arch=arch, bg_upsampler=bg_upsampler) File "/home/victorphilippe/research/VQFR/vqfr/demo_util.py", line 91, in __init__ 'warmup_iters': -1 File "/home/victorphilippe/research/VQFR/vqfr/archs/vqfrv1_arch.py", line 188, in __init__ self.quantizer = GeneralizedQuantizer(quantizer_opt) File "/home/victorphilippe/research/VQFR/vqfr/archs/vqganv1_arch.py", line 177, in __init__ self.quantize_dict[level_name] = build_quantizer(level_opt) File "/home/victorphilippe/research/VQFR/vqfr/archs/quantizer_arch.py", line 19, in build_quantizer quantizer = QUANTIZER_REGISTRY.get(quantizer_type)(**opt) TypeError: __init__() got an unexpected keyword argument 'in_dim' I am guessing this is a version issue with a package or something, but I have not been able to figure it out yet. I attached my package list below. Can you help me? Thanks!

_libgcc_mutex 0.1 conda_forge conda-forge _openmp_mutex 4.5 2_gnu conda-forge absl-py 1.3.0 pypi_0 pypi addict 2.4.0 pypi_0 pypi basicsr 1.4.2 pypi_0 pypi bzip2 1.0.8 h7f98852_4 conda-forge ca-certificates 2022.9.24 ha878542_0 conda-forge cachetools 5.2.0 pypi_0 pypi certifi 2022.9.24 pypi_0 pypi charset-normalizer 2.1.1 pypi_0 pypi colorama 0.4.6 pyhd8ed1ab_0 conda-forge cycler 0.11.0 pypi_0 pypi einops 0.6.0 pypi_0 pypi facexlib 0.2.5 pypi_0 pypi filelock 3.8.0 pypi_0 pypi filterpy 1.4.5 pypi_0 pypi fonttools 4.38.0 pypi_0 pypi future 0.18.2 pypi_0 pypi gfpgan 1.3.8 pypi_0 pypi google-auth 2.14.1 pypi_0 pypi google-auth-oauthlib 0.4.6 pypi_0 pypi grpcio 1.51.0 pypi_0 pypi huggingface-hub 0.11.0 pypi_0 pypi idna 3.4 pypi_0 pypi imageio 2.22.4 pypi_0 pypi importlib-metadata 5.0.0 pypi_0 pypi install 1.3.5 pypi_0 pypi joblib 1.2.0 pypi_0 pypi kiwisolver 1.4.4 pypi_0 pypi ld_impl_linux-64 2.39 hcc3a1bd_1 conda-forge libffi 3.4.2 h7f98852_5 conda-forge libgcc-ng 12.2.0 h65d4601_19 conda-forge libgomp 12.2.0 h65d4601_19 conda-forge libnsl 2.0.0 h7f98852_0 conda-forge libsqlite 3.40.0 h753d276_0 conda-forge libstdcxx-ng 12.2.0 h46fd767_19 conda-forge libuuid 2.32.1 h7f98852_1000 conda-forge libzlib 1.2.13 h166bdaf_4 conda-forge llvmlite 0.39.1 pypi_0 pypi lmdb 1.3.0 pypi_0 pypi markdown 3.4.1 pypi_0 pypi markupsafe 2.1.1 pypi_0 pypi matplotlib 3.5.3 pypi_0 pypi ncurses 6.3 h27087fc_1 conda-forge networkx 2.6.3 pypi_0 pypi numba 0.56.4 pypi_0 pypi numpy 1.20.3 pypi_0 pypi nvidia-cublas-cu11 11.10.3.66 pypi_0 pypi nvidia-cuda-nvrtc-cu11 11.7.99 pypi_0 pypi nvidia-cuda-runtime-cu11 11.7.99 pypi_0 pypi nvidia-cudnn-cu11 8.5.0.96 pypi_0 pypi oauthlib 3.2.2 pypi_0 pypi opencv-python 4.6.0.66 pypi_0 pypi openssl 3.0.7 h166bdaf_0 conda-forge packaging 21.3 pypi_0 pypi pillow 9.3.0 pypi_0 pypi pip 22.3.1 pyhd8ed1ab_0 conda-forge protobuf 3.20.3 pypi_0 pypi pyasn1 0.4.8 pypi_0 pypi pyasn1-modules 0.2.8 pypi_0 pypi pyparsing 3.0.9 pypi_0 pypi python 3.7.12 hf930737_100_cpython conda-forge python-dateutil 2.8.2 pypi_0 pypi pywavelets 1.3.0 pypi_0 pypi pyyaml 6.0 pypi_0 pypi readline 8.1.2 h0f457ee_0 conda-forge realesrgan 0.3.0 pypi_0 pypi requests 2.28.1 pypi_0 pypi requests-oauthlib 1.3.1 pypi_0 pypi rsa 4.9 pypi_0 pypi scikit-image 0.19.3 pypi_0 pypi scikit-learn 1.0.2 pypi_0 pypi scipy 1.7.3 pypi_0 pypi setuptools 65.6.0 pypi_0 pypi six 1.16.0 pypi_0 pypi sqlite 3.40.0 h4ff8645_0 conda-forge tb-nightly 2.12.0a20221121 pypi_0 pypi tensorboard-data-server 0.6.1 pypi_0 pypi tensorboard-plugin-wit 1.8.1 pypi_0 pypi threadpoolctl 3.1.0 pypi_0 pypi tifffile 2021.11.2 pypi_0 pypi timm 0.6.11 pypi_0 pypi tk 8.6.12 h27826a3_0 conda-forge torch 1.13.0 pypi_0 pypi torchvision 0.14.0 pypi_0 pypi tqdm 4.64.1 pyhd8ed1ab_0 conda-forge typing-extensions 4.4.0 pypi_0 pypi tzdata 2022f h191b570_0 conda-forge urllib3 1.26.12 pypi_0 pypi vqfr 2.0.0 dev_0 werkzeug 2.2.2 pypi_0 pypi wheel 0.38.4 pypi_0 pypi xz 5.2.6 h166bdaf_0 conda-forge yapf 0.32.0 pypi_0 pypi zipp 3.10.0 pypi_0 pypi

vlp47226 commented 1 year ago

Seems the issue is that, in demo_util.py, the quantizer_opt for the V1 version has the wrong type. I changed it from L2VectorQuantizer to L2VectorQuantizerKmeans and it worked