MachineLearningNotebooks icon indicating copy to clipboard operation
MachineLearningNotebooks copied to clipboard

Error trying to load azureml.train.automl

Open tylercmsft opened this issue 7 years ago • 3 comments

Hello, receiving the following error in an Azure Notebook VM while trying to import the ML library -

import json import pickle import numpy as np import pandas as pd

error here!!!

from azureml.train.automl import AutoMLConfig from sklearn.externals import joblib from azureml.core.model import Model import json import pickle import numpy as np import pandas as pd from azureml.train.automl import AutoMLConfig from sklearn.externals import joblib from azureml.core.model import Model

AttributeError Traceback (most recent call last) in 3 import numpy as np 4 import pandas as pd ----> 5 from azureml.train.automl import AutoMLConfig 6 from sklearn.externals import joblib 7 from azureml.core.model import Model

/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/train/automl/init.py in 23 # Suppress the warnings at the import phase. 24 warnings.simplefilter("ignore") ---> 25 from ._automl import fit_pipeline 26 from .automlconfig import AutoMLConfig 27 from .automl_step import AutoMLStep, AutoMLStepRun

/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/train/automl/_automl.py in 17 from automl.client.core.runtime.cache_store import CacheStore 18 from automl.client.core.runtime import logging_utilities as runtime_logging_utilities ---> 19 from azureml.automl.core import data_transformation, fit_pipeline as fit_pipeline_helper 20 from azureml.automl.core.automl_pipeline import AutoMLPipeline 21 from azureml.automl.core.data_context import RawDataContext, TransformedDataContext

/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/automl/core/fit_pipeline.py in 18 from automl.client.core.common.limit_function_call_exceptions import TimeoutException 19 from automl.client.core.runtime.datasets import DatasetBase ---> 20 from . import package_utilities, pipeline_run_helper, training_utilities 21 from .automl_base_settings import AutoMLBaseSettings 22 from .automl_pipeline import AutoMLPipeline

/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/automl/core/pipeline_run_helper.py in 18 from automl.client.core.common.exceptions import ClientException 19 from automl.client.core.runtime import metrics ---> 20 from automl.client.core.runtime import pipeline_spec as pipeline_spec_module 21 from automl.client.core.runtime.datasets import DatasetBase 22 from automl.client.core.runtime.execution_context import ExecutionContext

/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/automl/core/_vendor/automl/client/core/runtime/pipeline_spec.py in 21 22 from automl.client.core.common import constants ---> 23 from automl.client.core.runtime import model_wrappers, tf_wrappers 24 from automl.client.core.runtime.nimbus_wrappers import AveragedPerceptronBinaryClassifier,
25 AveragedPerceptronMulticlassClassifier, NimbusMlClassifierMixin, NimbusMlRegressorMixin

/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/automl/core/_vendor/automl/client/core/runtime/tf_wrappers.py in 34 os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' 35 if tf_found: ---> 36 tf.logging.set_verbosity(tf.logging.ERROR) 37 38 OPTIMIZERS = {

AttributeError: module 'tensorflow' has no attribute 'logging'

tylercmsft avatar Nov 05 '19 23:11 tylercmsft

Do you know which version of tensorflow you are using?

This SO question may be applicable: https://stackoverflow.com/questions/55318626/module-tensorflow-has-no-attribute-logging

rewagner87 avatar Nov 07 '19 18:11 rewagner87

Hello, Not sure about tensorflow. This is a "stock" Notebook VM that was created last week, so no changes were made to the libraries.

tylercmsft avatar Nov 07 '19 19:11 tylercmsft

Hello,

Sorry for the inconvenience. This issue has been fixed since v1.0.72 but, it's related to the fact that tf==2.0. is installed by default on the notebook instance. It broke other things too as TF2.0 has many changes in its API. Your two options are to upgrade to v1.0.72+ or use the following code to downgrade tensorflow.

pip install -U tensorflow-gpu==1.14.0 tensorflow==estimator==1.14.0

That should fix it for you.

cartacioS avatar Nov 14 '19 16:11 cartacioS