OpenMotionLab / MotionGPT

[NeurIPS 2023] MotionGPT: Human Motion as a Foreign Language, a unified motion-language generation model using LLMs
https://motion-gpt.github.io
MIT License
1.45k stars 92 forks source link

gradio app has error: "ValueError: Need to enable queue to use generator." #38

Open hdjsjyl opened 12 months ago

hdjsjyl commented 12 months ago

Hi Author, While running app.py, I input prompt, get the following error. Any suggestion is appreciated. Thanks

Traceback (most recent call last): File "/opt/conda/envs/mgpt/lib/python3.10/site-packages/gradio/routes.py", line 508, in predict output = await route_utils.call_process_api( File "/opt/conda/envs/mgpt/lib/python3.10/site-packages/gradio/route_utils.py", line 219, in call_process_api output = await app.get_blocks().process_api( File "/opt/conda/envs/mgpt/lib/python3.10/site-packages/gradio/blocks.py", line 1437, in process_api result = await self.call_function( File "/opt/conda/envs/mgpt/lib/python3.10/site-packages/gradio/blocks.py", line 1117, in call_function raise ValueError("Need to enable queue to use generators.") ValueError: Need to enable queue to use generators.

billl-jiang commented 12 months ago

Hi, @hdjsjyl

This error is caused by the discrepancy between running gradio on Huggingface spaces and running it locally. To address this, we have made updates to ensure it is compatible with running the web UI demo locally.

hdjsjyl commented 12 months ago

hi @billl-jiang , Thanks for your reply. I pull the changes and get the following error:

Global seed set to 1234 Traceback (most recent call last): File "/opt/conda/envs/mgpt/lib/python3.10/site-packages/pytorch_lightning/utilities/parsing.py", line 225, in getattr return self[key] KeyError: 'w_vectorizer'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/projects/MotionGPTv2/app.py", line 32, in model = build_model(cfg, datamodule) File "/projects/MotionGPTv2/mGPT/models/build_model.py", line 8, in build_model return instantiate_from_config(model_config) File "/projects/MotionGPTv2/mGPT/config.py", line 42, in instantiate_from_config return get_obj_from_str(config["target"])(config.get("params", dict())) File "/projects/MotionGPTv2/mGPT/models/mgpt.py", line 37, in init super().init() File “/projects/MotionGPTv2/mGPT/models/base.py", line 17, in init self.configure_metrics() File "/projects/MotionGPTv2/mGPT/models/base.py", line 142, in configure_metrics self.metrics = BaseMetrics(datamodule=self.datamodule, self.hparams) File "/projects/MotionGPTv2/mGPT/metrics/base.py", line 26, in init w_vectorizer=datamodule.hparams.w_vectorizer, File "/opt/conda/envs/mgpt/lib/python3.10/site-packages/pytorch_lightning/utilities/parsing.py", line 227, in getattr raise AttributeError(f'Missing attribute "{key}"') from exp AttributeError: Missing attribute "w_vectorizer"

Thanks

billl-jiang commented 12 months ago

The updates were previously stalled due to a network connection issue. Please try pulling from GitHub again.

hdjsjyl commented 12 months ago

HI @billl-jiang , It works now. Thanks for your help. The following is the result I got.

image

But it is different from the result of huggingface demo. Is there any way of getting the same results as huggingface demol for 3D avatar rendering? Thanks

kruzel commented 12 months ago

I just cloned code from huggingface and have same error, where can I find the fix?

image

shileims commented 12 months ago

The author has update the code in Github. You can try pull the latest code in github and try demo. The issue you mentioned has been solved. But will show results I mentioned above. @kruzel

kruzel commented 12 months ago

code on github require the dataset, can you tell me what change I should pull into huggingface code in order to fix?