williamyang1991 / StyleGANEX

[ICCV 2023] StyleGANEX: StyleGAN-Based Manipulation Beyond Cropped Aligned Faces
Other
510 stars 36 forks source link

Problem with launching Gradio on WIndows #11

Closed Astra060 closed 1 year ago

Astra060 commented 1 year ago

I installed everything right and other scripts are working but gradio doesn't work. I'm on Windows Traceback (most recent call last): File "app_gradio.py", line 97, in main() File "app_gradio.py", line 75, in main create_demo_inversion(model.process_inversion, allow_optimization=True) File "X:\StyleGANEX\webUI\app_task.py", line 313, in create_demo_inversion api_name='inversion') File "X:\StyleGANEX\venv\lib\site-packages\gradio\events.py", line 157, in call trigger_only_on_success=self.trigger_only_on_success, File "X:\StyleGANEX\venv\lib\site-packages\gradio\blocks.py", line 225, in set_event_trigger check_function_inputs_match(fn, inputs, inputs_as_dict) File "X:\StyleGANEX\venv\lib\site-packages\gradio\utils.py", line 749, in check_function_inputs_match parameter_types = get_type_hints(fn) File "X:\StyleGANEX\venv\lib\site-packages\gradio\utils.py", line 704, in get_type_hints return typing.get_type_hints(fn) File "X:\StyleGANEX\venv\lib\typing.py", line 1013, in get_type_hints value = _eval_type(value, globalns, localns) File "X:\StyleGANEX\venv\lib\typing.py", line 263, in _eval_type return t._evaluate(globalns, localns) File "X:\StyleGANEX\venv\lib\typing.py", line 467, in _evaluate eval(self.__forward_code__, globalns, localns), File "", line 1, in NameError: name 'file' is not defined

If it helps some file are redownloaded whenever I try to launch Gradio 100%|█████████████████████████████████████████████████████████████████████████████| 17.5k/17.5k [00:00<00:00, 1.05MB/s] 100%|█████████████████████████████████████████████████████████████████████████████| 4.01M/4.01M [00:02<00:00, 1.58MB/s] 100%|████████████████████████████████████████████████████████████████████████████████| 174k/174k [00:00<00:00, 628kB/s] 100%|█████████████████████████████████████████████████████████████████████████████| 4.11k/4.11k [00:00<00:00, 1.41MB/s] 100%|██████████████████████████████████████████████████████████████████████████████| 42.9k/42.9k [00:00<00:00, 350kB/s] 100%|██████████████████████████████████████████████████████████████████████████████| 74.1k/74.1k [00:00<00:00, 489kB/s] 100%|█████████████████████████████████████████████████████████████████████████████| 1.04M/1.04M [00:00<00:00, 1.26MB/s] 100%|███████████████████████████████████████████████████████████████████████████████| 901k/901k [00:00<00:00, 1.26MB/s]

These are the redownloads

williamyang1991 commented 1 year ago

Our code is tested on Gradio 3.4. Maybe you can try to install the 3.4 version and see if there are still problems.

Astra060 commented 1 year ago

Our code is tested on Gradio 3.4. Maybe you can try to install the 3.4 version and see if there are still problems.

thanks for the quick response, this did fix it, but I ran into 2 other problem, first was that the Name Server didn't work, it was set to 0.0.0.0, settings it to 127.0.0.1 fixed it (file is in app_gradio.py for anyone reading in the future).

the other problem is that where should I put the models? In Gradio it starts downloading the models again.

Astra060 commented 1 year ago

I figured it out myself, it would be nice to be able to set the location manually, but the models should be placed somewhere in $HF_HOME\hub\models--PKUWilliamYang--StyleGANEX\ then find the pretrained_models folder