Lightning-Universe / Pose-app

A Lightning app for animal pose estimation.
https://pose-app.readthedocs.io
Apache License 2.0
18 stars 2 forks source link

Impossible to start inference #121

Open olivier-cuttlefish opened 4 days ago

olivier-cuttlefish commented 4 days ago

Hello, I just started using the models and the app. Thank you for it, the models work very great when it manages to run. Unfortunately the app is extremely buggy for me which makes it hard to accomplish any task. Right now, I have found myself in a situation where I cannot run inference anymore. After uploading a video, clicking on inference doesn't do anything, apart from repetitive "light" page refresh, looking like this:

image

In terms of error, it is hard to pinpoint any in particular because the console keep printing errors throughout the workflow and from my understanding they most have to be ignored. Here are those I have right now:

Traceback (most recent call last):
  File "/home/olivier/mambaforge/envs/lai_test/lib/python3.10/site-packages/rest_framework/pagination.py", line 204, in paginate_queryset
    self.page = paginator.page(page_number)
  File "/home/olivier/mambaforge/envs/lai_test/lib/python3.10/site-packages/django/core/paginator.py", line 76, in page
    number = self.validate_number(number)
  File "/home/olivier/mambaforge/envs/lai_test/lib/python3.10/site-packages/django/core/paginator.py", line 58, in validate_number
    raise EmptyPage(_('That page contains no results'))
django.core.paginator.EmptyPage: That page contains no results

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/olivier/mambaforge/envs/lai_test/lib/python3.10/site-packages/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "/home/olivier/mambaforge/envs/lai_test/lib/python3.10/site-packages/django/utils/decorators.py", line 43, in _wrapper
    return bound_method(*args, **kwargs)
  File "/home/olivier/mambaforge/envs/lai_test/lib/python3.10/site-packages/label_studio/data_manager/api.py", line 305, in get
    page = self.paginate_queryset(queryset)
  File "/home/olivier/mambaforge/envs/lai_test/lib/python3.10/site-packages/rest_framework/generics.py", line 171, in paginate_queryset
    return self.paginator.paginate_queryset(queryset, self.request, view=self)
  File "/home/olivier/mambaforge/envs/lai_test/lib/python3.10/site-packages/label_studio/data_manager/api.py", line 231, in paginate_queryset
    return self.sync_paginate_queryset(queryset, request, view)
  File "/home/olivier/mambaforge/envs/lai_test/lib/python3.10/site-packages/label_studio/data_manager/api.py", line 225, in sync_paginate_queryset
    return super().paginate_queryset(queryset, request, view)
  File "/home/olivier/mambaforge/envs/lai_test/lib/python3.10/site-packages/rest_framework/pagination.py", line 209, in paginate_queryset
    raise NotFound(msg)
rest_framework.exceptions.NotFound: Invalid page.
[2024-11-27 00:50:16,309] [django.request::log_response::224] [WARNING] Not Found: /api/tasks/
[2024-11-27 00:50:16,309] [django.request::log_response::224] [WARNING] Not Found: /api/tasks/
[2024-11-27 00:50:16,310] [django.server::log_message::161] [WARNING] "GET /api/tasks?project=27&page=2&page_size=100&query=%7B%22filters%22%3A+null%2C+%22ordering%22%3A+%5B%5D%2C+%22selectedItems%22%3A+%7B%22all%22%3A+true%2C+%22excluded%22%3A+%5B%5D%7D%7D&fields=all&resolve_uri=True HTTP/1.1" 404 123
[2024-11-27 00:50:16,310] [django.server::log_message::161] [WARNING] "GET /api/tasks?project=27&page=2&page_size=100&query=%7B%22filters%22%3A+null%2C+%22ordering%22%3A+%5B%5D%2C+%22selectedItems%22%3A+%7B%22all%22%3A+true%2C+%22excluded%22%3A+%5B%5D%7D%7D&fields=all&resolve_uri=True HTTP/1.1" 404 123
INFO:APP.BASHWORK:python /home/olivier/Pose-app/lightning_pose_app/label_studio/check_labeling_task_and_export.py --label_studio_url http://localhost:40953 --proj_dir /home/olivier/Pose-app/data/Squid_FishHunting_neo --api_key whitenoise --keypoints_list arms_side/neck_side/tail_side/arms_top/neck_top/tail_top
[2024-11-27 00:50:31,167] [django.server::log_message::161] [INFO] "GET /api/version HTTP/1.1" 200 885
[2024-11-27 00:50:31,167] [django.server::log_message::161] [INFO] "GET /api/version HTTP/1.1" 200 885
[2024-11-27 00:50:31,182] [django.server::log_message::161] [INFO] "GET /api/projects/27 HTTP/1.1" 200 2727
[2024-11-27 00:50:31,182] [django.server::log_message::161] [INFO] "GET /api/projects/27 HTTP/1.1" 200 2727
[2024-11-27 00:50:33,559] [django.server::log_message::161] [INFO] "GET /api/projects/27/export?exportType=JSON&download_all_tasks=False&download_resources=False HTTP/1.1" 200 140636
[2024-11-27 00:50:33,559] [django.server::log_message::161] [INFO] "GET /api/projects/27/export?exportType=JSON&download_all_tasks=False&download_resources=False HTTP/1.1" 200 140636
ksikka commented 4 days ago

The light page happens after you click Run inference, or directly after uploading the video?

Can you inspect the browser's javascript console for any clues? Right click anywhere on the page, click Inspect, in the panel that opens click the Console tab.

As for the server side errors you shared, they are likely not responsible for the issue here. Maybe there's a real error hiding there somewhere?

themattinthehatt commented 4 days ago

@olivier-cuttlefish sorry for the frustrations - the streamlit interface can be frustrating sometimes. Another question - are you running the app locally or in the cloud? If locally, on linux or windows?

In the meantime, you can bypass the user interface by running inference using some command line scripts (which are generally better in the long-term anyways): https://pose-app.readthedocs.io/en/latest/source/guides/inference_on_large_videos.html

olivier-cuttlefish commented 4 days ago

@ksikka Thank you for the rapid answers. Here is a screenshot of the log. I forgot to mention that I was using Firefox 132.0, Ubuntu 20.04. I run the app locally as I have my own GPU. EDIT: The video is around 200MB~, I run the app with upload up to 1GB. image This started happening from the video upload, with the repetitive "light" refresh.

@themattinthehatt Thank you for your message. The inferences I ran on my dataset seemed to make the frustrations worth it though. I am indeed on the process to switch to the CLI.

Best, Olivier

ksikka commented 4 days ago

Is it that same error all the way to the top of the console?

The easiest thing is to try an incognito window to see if clearing the cookies fixes this.

ksikka commented 4 days ago

Also could you tell us if you're running the app on the same machine as the browser?

If not, some of these could be the cause: https://docs.streamlit.io/knowledge-base/deploy/remote-start

olivier-cuttlefish commented 3 days ago

Hello, I attached to this comment the full text file of the console log from when the app has started, and during which I load my project, upload my video, then try to click several times on the Run Inference button. All of that has been done using Firefox in Private Browsing mode (I made sure that Firefox would start by default in Private Browsing when the app started it). console-export-2024-11-28_10-30-36.txt

EDIT: Forgot to add that using the CLI I managed to run successfully inference on all of my videos.