AttributeError: 'list' object has no attribute 'constructor_args'
SteffenBlake opened this issue · 6 comments
Info:
Operating Systrem: Debian
Shell: zsh
Conda install: Anaconda
All steps were followed exactly as is in the README
Steps to reproduce:
Route 1:
Step 1: Upload an image to the demo gradio page
Step 2: Click and drag on the image in the top left panel.
Route 2:
Step 1 Upload an image to the demo gradio page
Step 2: Click on the "Add Drag" button
Expected results:
Ability to draw a red arrow on the image like the example images show
Actual Results:
- Top left panel greys out and is replaced with a textbox that says "Error"
- CLI outputs the following error stack:
AttributeError: 'list' object has no attribute 'constructor_args'
Traceback (most recent call last):
File "/home/sblake/anaconda3/envs/DragNUWA/lib/python3.8/site-packages/gradio/routes.py", line 534, in predict
output = await route_utils.call_process_api(
File "/home/sblake/anaconda3/envs/DragNUWA/lib/python3.8/site-packages/gradio/route_utils.py", line 226, in call_process_api
output = await app.get_blocks().process_api(
File "/home/sblake/anaconda3/envs/DragNUWA/lib/python3.8/site-packages/gradio/blocks.py", line 1550, in process_api
result = await self.call_function(
File "/home/sblake/anaconda3/envs/DragNUWA/lib/python3.8/site-packages/gradio/blocks.py", line 1185, in call_function
prediction = await anyio.to_thread.run_sync(
File "/home/sblake/anaconda3/envs/DragNUWA/lib/python3.8/site-packages/anyio/to_thread.py", line 56, in run_sync
return await get_async_backend().run_sync_in_worker_thread(
File "/home/sblake/anaconda3/envs/DragNUWA/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 2134, in run_sync_in_worker_thread
return await future
File "/home/sblake/anaconda3/envs/DragNUWA/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 851, in run
result = context.run(func, *args)
File "/home/sblake/anaconda3/envs/DragNUWA/lib/python3.8/site-packages/gradio/utils.py", line 661, in wrapper
response = f(*args, **kwargs)
File "DragNUWA_demo.py", line 243, in add_drag
tracking_points.constructor_args['value'].append([])
Upgrading to Gradio v4 can solve this problem.
pip install --upgrade gradio
Upgrading to Gradio v4 can solve this problem.
pip install --upgrade gradio
But! no effect
I'm also experiencing a similar problem.
Even after upgrading gradio, the issue is not resolved.
Running on local URL: http://127.0.0.1:7860
To create a public link, set `share=True` in `launch()`.
Traceback (most recent call last):
File "/home/kuronagirai/espnet/tools/miniconda/lib/python3.10/site-packages/gradio/routes.py", line 534, in predict
output = await route_utils.call_process_api(
File "/home/kuronagirai/espnet/tools/miniconda/lib/python3.10/site-packages/gradio/route_utils.py", line 226, in call_process_api
output = await app.get_blocks().process_api(
File "/home/kuronagirai/espnet/tools/miniconda/lib/python3.10/site-packages/gradio/blocks.py", line 1550, in process_api
result = await self.call_function(
File "/home/kuronagirai/espnet/tools/miniconda/lib/python3.10/site-packages/gradio/blocks.py", line 1185, in call_function
prediction = await anyio.to_thread.run_sync(
File "/home/kuronagirai/espnet/tools/miniconda/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/home/kuronagirai/espnet/tools/miniconda/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "/home/kuronagirai/espnet/tools/miniconda/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
result = context.run(func, *args)
File "/home/kuronagirai/espnet/tools/miniconda/lib/python3.10/site-packages/gradio/utils.py", line 661, in wrapper
response = f(*args, **kwargs)
File "/home/kuronagirai/DragNUWA/DragNUWA_demo.py", line 243, in add_drag
tracking_points.constructor_args['value'].append([])
AttributeError: 'list' object has no attribute 'constructor_args'
You selected None at [613, 2814] from image
Traceback (most recent call last):
File "/home/kuronagirai/espnet/tools/miniconda/lib/python3.10/site-packages/gradio/routes.py", line 534, in predict
output = await route_utils.call_process_api(
File "/home/kuronagirai/espnet/tools/miniconda/lib/python3.10/site-packages/gradio/route_utils.py", line 226, in call_process_api
output = await app.get_blocks().process_api(
File "/home/kuronagirai/espnet/tools/miniconda/lib/python3.10/site-packages/gradio/blocks.py", line 1550, in process_api
result = await self.call_function(
File "/home/kuronagirai/espnet/tools/miniconda/lib/python3.10/site-packages/gradio/blocks.py", line 1185, in call_function
prediction = await anyio.to_thread.run_sync(
File "/home/kuronagirai/espnet/tools/miniconda/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/home/kuronagirai/espnet/tools/miniconda/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "/home/kuronagirai/espnet/tools/miniconda/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
result = context.run(func, *args)
File "/home/kuronagirai/espnet/tools/miniconda/lib/python3.10/site-packages/gradio/utils.py", line 661, in wrapper
response = f(*args, **kwargs)
File "/home/kuronagirai/DragNUWA/DragNUWA_demo.py", line 296, in add_tracking_points
tracking_points.constructor_args['value'][-1].append(evt.index)
AttributeError: 'list' object has no attribute 'constructor_args'
gradio Version: 4.13.0
click button "upload image" first
click button "upload image" first
Oh! working ! !