-
Notifications
You must be signed in to change notification settings - Fork 863
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 : AttributeError: 'bytes' object has no attribute 'metrics' #772
Labels
bug
Something isn't working
Comments
abishekchiffon
changed the title
Unit test : AttributeError: 'bytes' object has no attribute 'metrics'
Torch handler Unit test : AttributeError: 'bytes' object has no attribute 'metrics'
Nov 4, 2020
abishekchiffon
added a commit
to abishekchiffon/serve
that referenced
this issue
Nov 4, 2020
…attribute 'metrics'
This was referenced Nov 4, 2020
dhanainme
pushed a commit
that referenced
this issue
Nov 6, 2020
…te 'metrics' (#774) Co-authored-by: Aaqib <maaquib@gmail.com>
dhanainme
pushed a commit
that referenced
this issue
Nov 7, 2020
abishekchiffon
added a commit
to abishekchiffon/serve
that referenced
this issue
Nov 20, 2020
abishekchiffon
added a commit
to abishekchiffon/serve
that referenced
this issue
Nov 20, 2020
abishekchiffon
added a commit
to abishekchiffon/serve
that referenced
this issue
Nov 20, 2020
dhanainme
pushed a commit
that referenced
this issue
Nov 23, 2020
* - updated image classifier default handler - updated custom resnet and mnist handlers - update docs * documentation update - removed stale Transformer_readme.md * updated docs * Doc restructure and code fixes * Updated example as per fix in default handlers * Enhanced base and custom handler examples * Missing checking for manifest * Fixed some typos * Removed commented code * Refactor BaseHandler * Adding in unit tests * Fixed gitignore in this branch * Fix a bug with Image Segmenter * Updated Object Detector to reuse functionality; consistency * Fix pylint errors * Backwards compat for index_names.json * Fixed Image Segmenter again * Made the compat layer in text actually compat. * Removed batching from text classifier * Adding comments per review. * Fixing doc feedback. * Updating docs about batching. * Initial commit of envelopes. * Got the end-to-end working * Undoing a change for local stuff. * Fixing a few broken tests. * Fixed error introduced due to conflict resolution via web based merge tool * Corrected code comment * - Updated Object detection & text classification handlers - updated docs * fixed python linting errors * updated index to name json text classifier * fixed object detector handler for batch support * Fixed the batch inference output * update expected output as per new handler changes * updated text classification mar name in sanity suite * updated text classifier mar name and removed bert scripted models * updated model zoo with new text classification url * added model_name in while registering model in sanity suite * updated text classification model name * added upgrade option for installing python dependencies in install utils * added upgrade option for installing python dependencies and extra numpy package in regression suite * refectored pytests in regression suite for better performance and reporting * Merge upstream * Got the end-to-end working * Merge upstream (2) * Fixing a few broken tests. * Undoing a bad merge. * minor fix in torch-archiver command * reverted postprocess removal * updated mar files in model zoo to use updated handlers * updated regression suite to use updated mar files * suppressed pylint warning in UT * fixed resnet-152 mar name and expected output * updated inference tests data - added tolerence value for resent152 models * Added custom handler in vgg11 example (#559) * added custom handler for vgg11 * added readme for vgg11 example * fixed typo in readme * updated model zoo * reverted back changes for scripted vgg11 mar file * added vgg11 model to regression test suite * disabled pylint check in UT * updated expected response for vgg11 inference in regression suite * updated expected response for vgg11 inference in regression suite * updated expected for densenet scripted * Fixing bad file format * Fixed the 'no newman npm' issue in regression test suite, solution suggested in PR 757 * Fixed the metrics bug #772 for test_envelopes Co-authored-by: Shivam Shriwas <shivamshriwas21@gmail.com> Co-authored-by: Harsh Bafna <harshbafna619@gmail.com> Co-authored-by: dhaniram kshirsagar <dhaniram_kshirsagar@persistent.com> Co-authored-by: dhaniram-kshirsagar <26479924+dhaniram-kshirsagar@users.noreply.github.com> Co-authored-by: Henry Tappen <htappen@gmail.com> Co-authored-by: harshbafna <harsh_bafna@persistent.co.in> Co-authored-by: Aaqib <maaquib@gmail.com> Co-authored-by: Henry Tappen <htappen@google.com> Co-authored-by: Geeta Chauhan <4461127+chauhang@users.noreply.github.com>
10 tasks
maaquib
added a commit
that referenced
this issue
Dec 1, 2020
* - updated image classifier default handler - updated custom resnet and mnist handlers - update docs * documentation update - removed stale Transformer_readme.md * updated docs * Doc restructure and code fixes * Updated example as per fix in default handlers * Enhanced base and custom handler examples * Missing checking for manifest * Fixed some typos * Removed commented code * Refactor BaseHandler * Adding in unit tests * Fixed gitignore in this branch * Fix a bug with Image Segmenter * Updated Object Detector to reuse functionality; consistency * Fix pylint errors * Backwards compat for index_names.json * Fixed Image Segmenter again * Made the compat layer in text actually compat. * Removed batching from text classifier * Adding comments per review. * Fixing doc feedback. * Updating docs about batching. * Initial commit of envelopes. * Got the end-to-end working * Undoing a change for local stuff. * Fixing a few broken tests. * Fixed error introduced due to conflict resolution via web based merge tool * Corrected code comment * - Updated Object detection & text classification handlers - updated docs * fixed python linting errors * updated index to name json text classifier * fixed object detector handler for batch support * Fixed the batch inference output * update expected output as per new handler changes * updated text classification mar name in sanity suite * updated text classifier mar name and removed bert scripted models * updated model zoo with new text classification url * added model_name in while registering model in sanity suite * updated text classification model name * added upgrade option for installing python dependencies in install utils * added upgrade option for installing python dependencies and extra numpy package in regression suite * refectored pytests in regression suite for better performance and reporting * Merge upstream * Got the end-to-end working * Merge upstream (2) * Fixing a few broken tests. * Undoing a bad merge. * minor fix in torch-archiver command * reverted postprocess removal * updated mar files in model zoo to use updated handlers * updated regression suite to use updated mar files * suppressed pylint warning in UT * fixed resnet-152 mar name and expected output * updated inference tests data - added tolerence value for resent152 models * Added custom handler in vgg11 example (#559) * added custom handler for vgg11 * added readme for vgg11 example * fixed typo in readme * updated model zoo * reverted back changes for scripted vgg11 mar file * added vgg11 model to regression test suite * disabled pylint check in UT * updated expected response for vgg11 inference in regression suite * updated expected response for vgg11 inference in regression suite * updated expected for densenet scripted * Fixing bad file format * Request envelope for KFServing * Modified Response of KFServing Envelope * KFServing envelope, classifier modified * fixed text variable issue in text_classifier_kf * Added kfserving envelope support for docker * Kfserving api changes to handle predict * Envelope modified for kFServing_V1 * text classifier captum with kfv1 explain endpoint * Added captum in mnist example * KFServing V1 endpoints with Captum for mnist and Text classifier * Captum changes in BERT, mnist and text class * Added mnist example for KFserving Transformers * Added KFserving wrappers and dockerfile * Modified kfserving dockerfile and entrypoint * Modified kfserving dockerfile and entrypoint to accept multiple arguments * Modified kf envelope and mnist handler for kf Transformer * Added load unload in kfserving wrapper * Modified docker files for kfserving load unload * Modified kfserving wrapper's dockerfile * Modified inference address and port in kfwrapper * Fixed the infaddress in kfwrapper * Modified MODEL_STORE and CONFIG_PATH location in kfwrapper for image testing * Response changes in base handler and kf envelope * Refactored base_handler and text_classifier_kf * Moved kf response from Base handler to postprocess of kf handlers * Bert fixed, removed load,unload in kfserving_wrapper * Refactored kfenvelope, mnist, base, text_classifier handlers with doc strings * Added separate bert handlers for kf and ts * Refactored kf_Bert * Fixed the Can't instantiate abstract class error in bert * Refactored kf_wrapper and relocated to kubernetes folder * Modified the readme for kfserving v1, relocated kf docker files to k8s folder * removed explain from envelope and base_handler * Contains kf v1_beta1 inference, with kf_wrapper * Fixed config.properties * Fixed context in text_handler * Fix the text_classifier_kf default handler's mar creation bug * Fixed InferenceRequestHandler sanity error * Removed remnant explain lines in vision and image classifier * kfwrapper log error fixed * Unification of kf and torchserve handlers * Handled unicode issue in bert to unify KF and TS handlers * Added kfserving image transformer to help image inference * postprocess function modified for kf request in text classifier - handles string of bytesarray in vision handler * Clean the handlers and envelope * Moved response for kfserving from postprocess to envelope * Fixed kf postprocess of text_classifier and bert * Unified dockerfile for kfserving and torchserve * Moved the unified KF and TS dockerfile to docker folder * Refactored kf image transformer * Dockerfile modified for kfserve and serve unification * modified kf and ts unified docker and entrypoint * modified docker entrypoint * Individual dockerfiles artifacts for kfserving and torchserve * Added kfserving in readmes of mnist, bert, text_class * Added mnist and mnist_kf test cases * Modified unnecessary array conversion in image_transform * Fixed kf dockerfile change directory * Fixed the 'no newman npm' issue in regression test suite, solution suggested in PR 757 * Fixed the gradle error in kf_infer api * Fixed the 'no newman npm' issue in the regression test suite, solution suggested as per PR #757 * fix: pylint and CI issue on running torchserve_sanity cuda101 * Removed kfserving mnist and bert handler files * Added bert, mnist and text classifier json inputs for kfserving curl requests * Modified the Readme files with with kfserving functionalities for mnist, text_classifier and bert * Modified kfserving dockerfile and config.properties * Moved kf request json files to kf_request_json folder and modified the readmes accordingly * Removed kfserving docs from the original readmes * KFServing files relocated and delta changes added to the kfserving readmes * Removed readme from kf_predictor_docker folder * Modified mnist handler to remove comments * Added img2bytearray conversion script for image_classifier * Unit test Mockcontext cleaned * Mock context cleaned * Mock context cleaned * Transformer handler cleaned * Fixed the metrics bug #772 for test_envelopes * cleaned test_envelope * Minor fixes in the image transformer and kfserving wrapper * Pylint fixes and doc string changes in the kfserving wrapper and kfserving image transformer Co-authored-by: Shivam Shriwas <shivamshriwas21@gmail.com> Co-authored-by: Harsh Bafna <harshbafna619@gmail.com> Co-authored-by: dhaniram kshirsagar <dhaniram_kshirsagar@persistent.com> Co-authored-by: dhaniram-kshirsagar <26479924+dhaniram-kshirsagar@users.noreply.github.com> Co-authored-by: Henry Tappen <htappen@gmail.com> Co-authored-by: harshbafna <harsh_bafna@persistent.co.in> Co-authored-by: Aaqib <maaquib@gmail.com> Co-authored-by: Henry Tappen <htappen@google.com> Co-authored-by: Geeta Chauhan <4461127+chauhang@users.noreply.github.com>
maaquib
added a commit
that referenced
this issue
Dec 10, 2020
…#809) * - updated image classifier default handler - updated custom resnet and mnist handlers - update docs * documentation update - removed stale Transformer_readme.md * updated docs * Doc restructure and code fixes * Updated example as per fix in default handlers * Enhanced base and custom handler examples * Missing checking for manifest * Fixed some typos * Removed commented code * Refactor BaseHandler * Adding in unit tests * Fixed gitignore in this branch * Fix a bug with Image Segmenter * Updated Object Detector to reuse functionality; consistency * Fix pylint errors * Backwards compat for index_names.json * Fixed Image Segmenter again * Made the compat layer in text actually compat. * Removed batching from text classifier * Adding comments per review. * Fixing doc feedback. * Updating docs about batching. * Initial commit of envelopes. * Got the end-to-end working * Undoing a change for local stuff. * Fixing a few broken tests. * Fixed error introduced due to conflict resolution via web based merge tool * Corrected code comment * - Updated Object detection & text classification handlers - updated docs * fixed python linting errors * updated index to name json text classifier * fixed object detector handler for batch support * Fixed the batch inference output * update expected output as per new handler changes * updated text classification mar name in sanity suite * updated text classifier mar name and removed bert scripted models * updated model zoo with new text classification url * added model_name in while registering model in sanity suite * updated text classification model name * added upgrade option for installing python dependencies in install utils * added upgrade option for installing python dependencies and extra numpy package in regression suite * refectored pytests in regression suite for better performance and reporting * Merge upstream * Got the end-to-end working * Merge upstream (2) * Fixing a few broken tests. * Undoing a bad merge. * minor fix in torch-archiver command * reverted postprocess removal * updated mar files in model zoo to use updated handlers * updated regression suite to use updated mar files * suppressed pylint warning in UT * fixed resnet-152 mar name and expected output * updated inference tests data - added tolerence value for resent152 models * Added custom handler in vgg11 example (#559) * added custom handler for vgg11 * added readme for vgg11 example * fixed typo in readme * updated model zoo * reverted back changes for scripted vgg11 mar file * added vgg11 model to regression test suite * disabled pylint check in UT * updated expected response for vgg11 inference in regression suite * updated expected response for vgg11 inference in regression suite * updated expected for densenet scripted * Fixing bad file format * Request envelope for KFServing * Modified Response of KFServing Envelope * KFServing envelope, classifier modified * fixed text variable issue in text_classifier_kf * Added kfserving envelope support for docker * Kfserving api changes to handle predict * Envelope modified for kFServing_V1 * text classifier captum with kfv1 explain endpoint * Added captum in mnist example * KFServing V1 endpoints with Captum for mnist and Text classifier * Captum changes in BERT, mnist and text class * Added mnist example for KFserving Transformers * Added KFserving wrappers and dockerfile * Modified kfserving dockerfile and entrypoint * Modified kfserving dockerfile and entrypoint to accept multiple arguments * Modified kf envelope and mnist handler for kf Transformer * Added load unload in kfserving wrapper * Modified docker files for kfserving load unload * Modified kfserving wrapper's dockerfile * Modified inference address and port in kfwrapper * Fixed the infaddress in kfwrapper * Modified MODEL_STORE and CONFIG_PATH location in kfwrapper for image testing * Response changes in base handler and kf envelope * Refactored base_handler and text_classifier_kf * Moved kf response from Base handler to postprocess of kf handlers * Bert fixed, removed load,unload in kfserving_wrapper * Refactored kfenvelope, mnist, base, text_classifier handlers with doc strings * Added separate bert handlers for kf and ts * Refactored kf_Bert * Fixed the Can't instantiate abstract class error in bert * Refactored kf_wrapper and relocated to kubernetes folder * Modified the readme for kfserving v1, relocated kf docker files to k8s folder * Created unified text_classifier handler for kf and TS with captum * Added explanations api for torchserve * Created unified mnist handler for kf and TS with captum * Added end to end readme to run torchserve in kfserving predictor * Created the Unified bert handler for KFserving and TS * Added kfserving image transformer with explain * Modified kfserving wrapper and predictor_docker to reflect infer changes * Removed unneccessary image_transform code in kfserving transformer * Modified describe api and inference_open_api json files for gradle error * Build gradle issue fix: file formatting, syntax formatting * Added torchserve explanations curl request and modified end to end kfserving url in the readmes * Cleaned the code and made it pylint compatible * Modified ts branch name in kf_predictor docker file * Modified kf_predictor_docker readme to add explain request * Add torchserve json request files for bert, mnist, text_classifier * Moved kf request json files to kubernetes/kf_request_json folder * Added explainations unit test unders ts/torch_handler/unit_test/image_classifier * Modified Readmes to change the path of kfserving json files * Fix for unit test metrics issue in mock context * Fix no newman error in regression test suite * Added captum in requirements cpu and gpu * Removed the separate handlers of kfserving * Modified run_unit_test.sh * Cleaned mock context * Added utils in text_classifier * Added captum explanations to the readmes of mnist, text_classification and bert * KFServing files relocated and delta changes added to the kfserving readmes * Removed readme from kf_predictor_docker folder * Modified kfserving readmes * Modified KFserving readme and added img2bytearray script * handler readme modifications and text_classifier captum note * Modified img2bytearray in kfserving readme * Added captum explanations example and readmes for bert * Added captum explanations readme * Bert captum visualization image rendered in notebook * Updated bert Readme with captum approach * Captum folder with visualization implementation guide for mnist and bert * Modified the mnist, bert notebooks and readmes * Removed duplicate captum visualization notebook files, fixed text_handler pylint issue * Added captum in custom_service.md, Added kf_v1 health check api in the docs * Separated the envelope test in run_unit_tests * Fixed the metrics bug #772 for test_envelopes * Fixed pylint newline in test_envelope * Fixed pylint torchserve test_envelope.py * Moved captum requirements from torch.txt to common.txt * Added comments in listinferenceapi for kfserving v1 api * Modified the comment in listinferenceapi * Format error in listinferenceapi for comment * Formatted Opentutils * Fixed pylint and changed doc string in Kfserving * Added Unit testcases for kf and captum apis in frontend Co-authored-by: Shivam Shriwas <shivamshriwas21@gmail.com> Co-authored-by: Harsh Bafna <harshbafna619@gmail.com> Co-authored-by: dhaniram kshirsagar <dhaniram_kshirsagar@persistent.com> Co-authored-by: dhaniram-kshirsagar <26479924+dhaniram-kshirsagar@users.noreply.github.com> Co-authored-by: Henry Tappen <htappen@gmail.com> Co-authored-by: harshbafna <harsh_bafna@persistent.co.in> Co-authored-by: Aaqib <maaquib@gmail.com> Co-authored-by: Henry Tappen <htappen@google.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context
The handler unit tests in the ts/torch_handler folder fails in the master branch.
It fails with the following error "AttributeError: 'bytes' object has no attribute 'metrics'" in the base_handler handle function at the line.
metrics = self.context.metrics, when you run ./run_unit_test.sh
Your Environment
[If public url then provide link.]:
Expected Behavior
The unit tests should all pass, without any metrics issue.
Current Behavior
AttributeError: 'bytes' object has no attribute 'metrics'
Possible Solution
Fix the mock_context and add metrics.
Steps to Reproduce
Failure Logs [if any]
unit_tests_metrics_master.log
The text was updated successfully, but these errors were encountered: