solliancenet / tech-immersion-data-ai

123 stars 142 forks source link

Error importing AutoMLExplainerSetupClass, automl_setup_model_explanations #24

Closed jason-theodorakopoulos closed 4 years ago

jason-theodorakopoulos commented 4 years ago

The below line from azureml.train.automl.runtime.automl_explain_utilities import AutoMLExplainerSetupClass, automl_setup_model_explanations on this file throws the below error. As a result notebook and demo cannot run.

error                                     Traceback (most recent call last)
<ipython-input-5-78e6c8769ece> in <module>
      9 from azureml.train.automl.run import AutoMLRun
     10 
---> 11 from azureml.train.automl.runtime.automl_explain_utilities import AutoMLExplainerSetupClass, automl_setup_model_explanations
     12 from interpret_community.mimic.models import LGBMExplainableModel
     13 from azureml.interpret.mimic_wrapper import MimicWrapper

/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/train/automl/runtime/automl_explain_utilities.py in <module>
     18 
     19 from azureml.automl.core import dataprep_utilities, package_utilities
---> 20 from azureml.automl.runtime.featurization.streaming import StreamingFeaturizationTransformer
     21 from azureml.automl.runtime.training_utilities import LargeDatasetLimit
     22 from azureml.data import TabularDataset

/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/automl/runtime/featurization/__init__.py in <module>
      6 
      7 # Data transformer
----> 8 from .data_transformer import DataTransformer
      9 
     10 

/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/automl/runtime/featurization/data_transformer.py in <module>
     42 from ..stats_computation import PreprocessingStatistics as _PreprocessingStatistics
     43 
---> 44 from ..featurizer.transformer import AutoMLTransformer, CategoricalFeaturizers, DateTimeFeaturesTransformer,\
     45     GenericFeaturizers, get_ngram_len, TextFeaturizers
     46 from azureml.automl.core.featurization.featurizationconfig import FeaturizationConfig

/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/automl/runtime/featurizer/transformer/__init__.py in <module>
     21 
     22 # Text
---> 23 from .text import get_ngram_len, NaiveBayes, StringCastTransformer, max_ngram_len, \
     24     TextFeaturizers, WordEmbeddingTransformer, TFIDF_VECTORIZER_CONFIG, NimbusMLTextTargetEncoder, \
     25     BagOfWordsTransformer, StatsTransformer, StringConcatTransformer, BiLSTMAttentionTransformer

/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/automl/runtime/featurizer/transformer/text/__init__.py in <module>
      6 from .stringcast_transformer import StringCastTransformer
      7 from .utilities import get_ngram_len, max_ngram_len
----> 8 from .text_featurizers import TextFeaturizers
      9 from .wordembedding_transformer import WordEmbeddingTransformer
     10 from .pretrained_text_dnn_transformer import PretrainedTextDNNTransformer

/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/automl/runtime/featurizer/transformer/text/text_featurizers.py in <module>
     25 from ..generic.modelbased_target_encoder import ModelBasedTargetEncoder
     26 from ..featurization_utilities import if_package_exists
---> 27 from .bilstm_attention_transformer import BiLSTMAttentionTransformer
     28 
     29 from .constants import NIMBUS_ML_PARAMS

/anaconda/envs/azureml_py36/lib/python3.6/site-packages/azureml/automl/runtime/featurizer/transformer/text/bilstm_attention_transformer.py in <module>
     32 
     33 if pkg_dependencies_satisfied:
---> 34     en_tokenize = en_core_web_sm.load()
     35 
     36     class BaseModel(torch.nn.Module):

/anaconda/envs/azureml_py36/lib/python3.6/site-packages/en_core_web_sm/__init__.py in load(**overrides)
     10 
     11 def load(**overrides):
---> 12     return load_model_from_init_py(__file__, **overrides)

/anaconda/envs/azureml_py36/lib/python3.6/site-packages/spacy/util.py in load_model_from_init_py(init_file, **overrides)
    188     if not model_path.exists():
    189         raise IOError(Errors.E052.format(path=path2str(data_path)))
--> 190     return load_model_from_path(data_path, meta, **overrides)
    191 
    192 

/anaconda/envs/azureml_py36/lib/python3.6/site-packages/spacy/util.py in load_model_from_path(model_path, meta, **overrides)
    171             component = nlp.create_pipe(name, config=config)
    172             nlp.add_pipe(component, name=name)
--> 173     return nlp.from_disk(model_path)
    174 
    175 

/anaconda/envs/azureml_py36/lib/python3.6/site-packages/spacy/language.py in from_disk(self, path, exclude, disable)
    789             # Convert to list here in case exclude is (default) tuple
    790             exclude = list(exclude) + ["vocab"]
--> 791         util.from_disk(path, deserializers, exclude)
    792         self._path = path
    793         return self

/anaconda/envs/azureml_py36/lib/python3.6/site-packages/spacy/util.py in from_disk(path, readers, exclude)
    628         # Split to support file names like meta.json
    629         if key.split(".")[0] not in exclude:
--> 630             reader(path / key)
    631     return path
    632 

/anaconda/envs/azureml_py36/lib/python3.6/site-packages/spacy/language.py in <lambda>(p)
    779         deserializers["meta.json"] = lambda p: self.meta.update(srsly.read_json(p))
    780         deserializers["vocab"] = lambda p: self.vocab.from_disk(p) and _fix_pretrained_vectors_name(self)
--> 781         deserializers["tokenizer"] = lambda p: self.tokenizer.from_disk(p, exclude=["vocab"])
    782         for name, proc in self.pipeline:
    783             if name in exclude:

tokenizer.pyx in spacy.tokenizer.Tokenizer.from_disk()

tokenizer.pyx in spacy.tokenizer.Tokenizer.from_bytes()

/anaconda/envs/azureml_py36/lib/python3.6/re.py in compile(pattern, flags)
    231 def compile(pattern, flags=0):
    232     "Compile a regular expression pattern, returning a pattern object."
--> 233     return _compile(pattern, flags)
    234 
    235 def purge():

/anaconda/envs/azureml_py36/lib/python3.6/re.py in _compile(pattern, flags)
    299     if not sre_compile.isstring(pattern):
    300         raise TypeError("first argument must be string or compiled pattern")
--> 301     p = sre_compile.compile(pattern, flags)
    302     if not (flags & DEBUG):
    303         if len(_cache) >= _MAXCACHE:

/anaconda/envs/azureml_py36/lib/python3.6/sre_compile.py in compile(p, flags)
    560     if isstring(p):
    561         pattern = p
--> 562         p = sre_parse.parse(p, flags)
    563     else:
    564         pattern = None

/anaconda/envs/azureml_py36/lib/python3.6/sre_parse.py in parse(str, flags, pattern)
    853 
    854     try:
--> 855         p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, 0)
    856     except Verbose:
    857         # the VERBOSE flag was switched on inside the pattern.  to be

/anaconda/envs/azureml_py36/lib/python3.6/sre_parse.py in _parse_sub(source, state, verbose, nested)
    414     while True:
    415         itemsappend(_parse(source, state, verbose, nested + 1,
--> 416                            not nested and not items))
    417         if not sourcematch("|"):
    418             break

/anaconda/envs/azureml_py36/lib/python3.6/sre_parse.py in _parse(source, state, verbose, nested, first)
    525                     break
    526                 elif this[0] == "\\":
--> 527                     code1 = _class_escape(source, this)
    528                 else:
    529                     code1 = LITERAL, _ord(this)

/anaconda/envs/azureml_py36/lib/python3.6/sre_parse.py in _class_escape(source, escape)
    334         if len(escape) == 2:
    335             if c in ASCIILETTERS:
--> 336                 raise source.error('bad escape %s' % escape, len(escape))
    337             return LITERAL, ord(escape[1])
    338     except ValueError:

error: bad escape \p at position 257
shirolkar commented 4 years ago

This issue was fixed. Please reopen if it persists.