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

Torch handler Unit test : AssertionError for test_object_detector.py #773

Closed
abishekchiffon opened this issue Nov 4, 2020 · 0 comments · Fixed by #775
Closed

Torch handler Unit test : AssertionError for test_object_detector.py #773

abishekchiffon opened this issue Nov 4, 2020 · 0 comments · Fixed by #775
Assignees
Labels
bug Something isn't working

Comments

@abishekchiffon
Copy link
Contributor

abishekchiffon commented Nov 4, 2020

Context

The handler unit tests in the ts/torch_handler folder fails in the master branch.
As you run "./run_unit_test.sh" , it fails with the following error

AssertionError: assert 'bench' in [{'person': [167.4222869873047, 57.03825378417969, 301.305419921875, 436.68682861328125], 'score': 0.9995299577713013}...bag': [379.4246826171875, 259.97760009765625, 419.0148620605469, 317.9510498046875], 'score': 0.9896279573440552}, ...]

in the test_object_detector.py file in the line assert('bench' in results[0]).

  • torchserve version:0.2.0b20201104
  • torch version:1.6.0
  • torchvision version [if any]:0.7.0
  • torchtext version [if any]:0.7.0
  • torchaudio version [if any]: NA
  • java version:11.0.5
  • Operating System and version: ubuntu 16.04

Your Environment

  • Installed using source? [yes/no]: yes
  • Are you planning to deploy it using docker container? [yes/no]: no
  • Is it a CPU or GPU environment?: CPU
  • Using a default/custom handler? [If possible upload/share custom handler/model]: NA
  • What kind of model is it e.g. vision, text, audio?: NA
  • Are you planning to use local models from model-store or public url being used e.g. from S3 bucket etc.? local models
    [If public url then provide link.]:
  • Provide config.properties, logs [ts.log] and parameters used for model registration/update APIs: NA
  • Link to your project [if any]: NA

Expected Behavior

The object detector unit test should pass.

Current Behavior

AssertionError: assert 'bench' in [{'person': [167.4222869873047, 57.03825378417969, 301.305419921875, 436.68682861328125], 'score': 0.9995299577713013}...bag': [379.4246826171875, 259.97760009765625, 419.0148620605469, 317.9510498046875], 'score': 0.9896279573440552}, ...]

Possible Solution

Modify the object_detector_unit_test to properly asserts the object_detector response.

Steps to Reproduce

  1. Run ./scripts/install_from_src
    2.Run "run_unit_test.sh" inside the folder ts/torch_handler/unit_tests

Failure Logs [if any]

unit_test_metrics_object_detector.log

@harshbafna harshbafna added the bug Something isn't working label Nov 4, 2020
abishekchiffon added a commit to abishekchiffon/serve that referenced this issue Nov 4, 2020
dhanainme pushed a commit that referenced this issue Nov 7, 2020
* Fixes #772: unit test attribute error - 'bytes' object has no attribute 'metrics'

* Fixes #773 : Unit test - AssertionError for test_object_detector.py

Co-authored-by: Aaqib <maaquib@gmail.com>
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.

2 participants