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

Don't start thread before Task.run() #22

Closed
kenoss opened this issue Sep 21, 2021 · 0 comments · Fixed by #28
Closed

Don't start thread before Task.run() #22

kenoss opened this issue Sep 21, 2021 · 0 comments · Fixed by #28
Labels
bug Something isn't working

Comments

@kenoss
Copy link
Contributor

kenoss commented Sep 21, 2021

Code like

    cap = NVArgusCameraCapture((CAPTURE_WIDTH, CAPTURE_HEIGHT), FPS)
    app.register_task(cap)

    # Classifier task
    conv = Classifier((CAPTURE_WIDTH, CAPTURE_HEIGHT)) 
    app.register_task(conv)    

    # Presenter task
    pres = Presenter(settings, cmd)
    app.register_task(pres)

    # Make task connection
    cap.connect(conv) # from `cap` to `conv`
    conv.connect(pres)  # from `conv` to `pres`

    # Start application
    app.run()

should reproduce the following error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/actfw_jetson/camera.py", line 97, in _appsink_on_new_sample
    slf._outlet(frame)
  File "/usr/local/lib/python3.6/dist-packages/actfw_core/task/producer.py", line 40, in _outlet
    self.out_queues[self.out_queue_id].put(o, timeout=1)
IndexError: list index out of range

I guess this is because NVArgusCameraCapture.__init__() starts thread. Task must produce data after app.run() (More preceicely, after Task.connect()).
This code should be sit in NVArgusCameraCapture.run().

@kenoss kenoss added the bug Something isn't working label Sep 21, 2021
ishiy1993 added a commit that referenced this issue Apr 21, 2022
@ishiy1993 ishiy1993 mentioned this issue Apr 21, 2022
1 task
ishiy1993 added a commit that referenced this issue Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant