Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: x must contain at least 2 elements. #20

Open
nathanshipley opened this issue Jan 17, 2024 · 1 comment
Open

ValueError: x must contain at least 2 elements. #20

nathanshipley opened this issue Jan 17, 2024 · 1 comment

Comments

@nathanshipley
Copy link

Ubuntu 22. Followed README instructions, created environment, downloaded the model, Gradio interface launches. I add some arrows, click run, and get this error:

Running on local URL:  http://0.0.0.0:7860

To create a public link, set `share=True` in `launch()`.
You selected None at [425, 108] from image
You selected None at [385, 93] from image
You selected None at [345, 87] from image
You selected None at [219, 239] from image
You selected None at [264, 242] from image
You selected None at [303, 239] from image
You selected None at [183, 122] from image
You selected None at [143, 123] from image
You selected None at [105, 128] from image
Traceback (most recent call last):
  File "/home/nathan/anaconda3/envs/DragNUWA/lib/python3.8/site-packages/gradio/queueing.py", line 495, in call_prediction
    output = await route_utils.call_process_api(
  File "/home/nathan/anaconda3/envs/DragNUWA/lib/python3.8/site-packages/gradio/route_utils.py", line 232, in call_process_api
    output = await app.get_blocks().process_api(
  File "/home/nathan/anaconda3/envs/DragNUWA/lib/python3.8/site-packages/gradio/blocks.py", line 1561, in process_api
    result = await self.call_function(
  File "/home/nathan/anaconda3/envs/DragNUWA/lib/python3.8/site-packages/gradio/blocks.py", line 1179, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "/home/nathan/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/nathan/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/nathan/anaconda3/envs/DragNUWA/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 851, in run
    result = context.run(func, *args)
  File "/home/nathan/anaconda3/envs/DragNUWA/lib/python3.8/site-packages/gradio/utils.py", line 678, in wrapper
    response = f(*args, **kwargs)
  File "DragNUWA_demo.py", line 152, in run
    splited_track = interpolate_trajectory(splited_track, self.model_length)
  File "DragNUWA_demo.py", line 21, in interpolate_trajectory
    fx = PchipInterpolator(t, x)
  File "/home/nathan/anaconda3/envs/DragNUWA/lib/python3.8/site-packages/scipy/interpolate/_cubic.py", line 234, in __init__
    x, _, y, axis, _ = prepare_input(x, y, axis)
  File "/home/nathan/anaconda3/envs/DragNUWA/lib/python3.8/site-packages/scipy/interpolate/_cubic.py", line 46, in prepare_input
    raise ValueError("`x` must contain at least 2 elements.")
ValueError: `x` must contain at least 2 elements.

Any ideas?
Screenshot from 2024-01-17 10-31-50

@nathanshipley
Copy link
Author

I figured out a hack to work around this. Before, if I just create drags and then press Run, I get the ValueError mentioned above.

Fix: Create an extra drag I don't want, and then press Delete last drag and Run executes successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant