Skip to content
Snippets Groups Projects

[livdet-iris-2020] Fix category type in view

Merged Amir MOHAMMADI requested to merge livedet-iris-2020 into master
1 unresolved thread

The view expects an int32 for the category output.

Edited by Amir MOHAMMADI

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
37 37 elif output == "label":
38 38 return {"value": bool(obj.label)}
39 39 elif output == "category":
40 return {"value": int(obj.category)}
40 return {"value": np.cast["int32"](obj.category)}
  • Author Contributor

    btw the error for this was like this:

    $ beat exp run amohammadi/amohammadi/livdet/1/livedet
    Skipping execution of `amohammadi/livdet_baseline/1' for block `algorithm' - outputs exist
    Running `amohammadi/livdet_analyzer/1' for block `analyzer'
    Start the execution of 'amohammadi/livdet_analyzer/1'
    Block did not execute properly - outputs were reset
      Standard output:
        
      Standard error:
        
      Captured user error:
        File "/home/amir/miniconda/envs/iris/lib/python3.7/site-packages/beat/backend/python/baseformat.py", line 115, in setup_scalar
            % (attrname, formatname, numpy.array(value).dtype, dtype)
        TypeError: cannot safely cast attribute `value' on dataformat `system/integer/1' with type `int64' to `int32' without precision loss
      Captured system error:
        
    Error: Error occured: returned value is 1
    Removing cache files: No data written

    which was very hard to debug.

  • If it's not already in the documentation, I at least explained when presenting the platform that it's important to properly type what you write to the outputs as type conversion may fail for values as simple as 0.

  • Author Contributor

    I know that values need to be casted. The problem here is that the backtrace error I was getting was not telling me this error was in the view and not in my analyzer (the step I was on when hitting this error). So, I kept looking at my analyzer and thinking why I get this error while the error was in the view.

  • I see where the issue might be here: the logs of both containers are concatenated without context.

    Can you open an issue on beat/beat.core> to improve that.

  • Please register or sign in to reply
  • merged

  • Samuel GAIST mentioned in commit 5265c226

    mentioned in commit 5265c226

  • mentioned in issue beat.core#100

  • Please register or sign in to reply
    Loading