aws / sagemaker-experiments

Experiment tracking and metric logging for Amazon SageMaker notebooks and model training.
Apache License 2.0
126 stars 36 forks source link

Iterating through TrialComponent.list() gives AttributeError #93

Closed dz902 closed 4 years ago

dz902 commented 4 years ago

Describe the bug Iterating through TrialComponent.list() gives: AttributeError: 'NoneType' object has no attribute 'list_trial_components'

There are trial components, just not associated with any trial.

To Reproduce

from smexperiments.trial_component import TrialComponent

for TRIAL_COMPONENT_INFO in TrialComponent.list():
    print(TRIAL_COMPONENT_INFO)

Expected behavior Shows a list of trial components whether they are associated with trials or not, as I would expect it to be a wrapper of the "ListTrialComponents" API call.

Screenshots If applicable, add screenshots to help explain your problem.

Environment: Framework (e.g. TensorFlow) / Algorithm (e.g. KMeans): Framework Version: Python Version: CPU or GPU: Python SDK Version: Are you using a custom image:

Additional context Add any other context about the problem here.

dz902 commented 4 years ago

The error happens on this line:

https://github.com/aws/sagemaker-experiments/blob/0d78708c4cdd7d2a94a97742bc723c05f12da829/src/smexperiments/_base_types.py#L123

I think the a default boto client was not created as documented. It seems that the following line wasn't working.

https://github.com/aws/sagemaker-experiments/blob/0d78708c4cdd7d2a94a97742bc723c05f12da829/src/smexperiments/_base_types.py#L116

Not sure why.

danabens commented 4 years ago

Looks like you have an older version, need to upgrade to get https://github.com/aws/sagemaker-experiments/commit/ef2af4009c3a5c6a63db5cec6b9de6c614dfdd66 .

pip install sagemaker-experiments --upgrade