aws-samples / sagemaker-101-workshop

Hands-on demonstrations for data scientists exploring Amazon SageMaker
77 stars 48 forks source link

News Headline Classifier (SageMaker Version) - No module named 'tensorflow.python.eager' #7

Closed yohei1126 closed 3 years ago

yohei1126 commented 3 years ago

I have tried this notebook with Python 3 (TensorFlow 1.15 Python 3.7 CPU Optimized) kernel then got this error.

https://github.com/apac-ml-tfc/sagemaker-workshop-101/blob/master/custom_tensorflow_keras_nlp/Headline%20Classifier%20SageMaker.ipynb

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<timed exec> in <module>

~/sagemaker-101-workshop/custom_tensorflow_keras_nlp/util/preprocessing.py in <module>
     13 import numpy as np
     14 from sklearn import preprocessing
---> 15 import tensorflow as tf
     16 from tensorflow.keras.preprocessing.text import Tokenizer
     17 from tensorflow.keras.preprocessing.sequence import pad_sequences

/usr/local/lib/python3.7/site-packages/tensorflow/__init__.py in <module>
     39 import sys as _sys
     40 
---> 41 from tensorflow.python.tools import module_util as _module_util
     42 from tensorflow.python.util.lazy_loader import LazyLoader as _LazyLoader
     43 

/usr/local/lib/python3.7/site-packages/tensorflow/python/__init__.py in <module>
     38 # pylint: disable=wildcard-import,g-bad-import-order,g-import-not-at-top
     39 
---> 40 from tensorflow.python.eager import context
     41 from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow
     42 

ModuleNotFoundError: No module named 'tensorflow.python.eager'
yohei1126 commented 3 years ago

This issues was fixed after restarting the Kernel.