I have just started up with tensor flow I am facing the following issue when trying to use TF in python.
Complete stack trace:
C:\Users\v.ganugapati\Desktop\Varchala Machine Learning>cd "c:\Users\v.ganugapati\Desktop\Varchala Machine Learning" && cmd /C "set "PYTHONIOENCODING=UTF-8" && set "PYTHONUNBUFFERED=1" && C:/Users/v.ganugapati/AppData/Local/Programs/Python/Python37/python.exe c:\Users\v.ganugapati.vscode\extensions\ms-python.python-2019.1.0\pythonFiles\ptvsd_launcher.py
--default --client --host localhost --port 49965 "c:\Users\v.ganugapati\Desktop\Varchala Machine Learning\Chatbot_v.01\TFExample.py" "
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
ImportError: numpy.core.multiarray failed to import
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "", line 980, in _find_and_load
SystemError: <class '_frozen_importlib._ModuleLockManager'> returned a result with an error set
ImportError: numpy.core._multiarray_umath failed to import
ImportError: numpy.core.umath failed to import
2019-02-11 11:18:48.276548: F tensorflow/python/lib/core/bfloat16.cc:675] Check failed: PyBfloat16_Type.tp_base != nullptr
I have just started up with tensor flow I am facing the following issue when trying to use TF in python.
Complete stack trace:
C:\Users\v.ganugapati\Desktop\Varchala Machine Learning>cd "c:\Users\v.ganugapati\Desktop\Varchala Machine Learning" && cmd /C "set "PYTHONIOENCODING=UTF-8" && set "PYTHONUNBUFFERED=1" && C:/Users/v.ganugapati/AppData/Local/Programs/Python/Python37/python.exe c:\Users\v.ganugapati.vscode\extensions\ms-python.python-2019.1.0\pythonFiles\ptvsd_launcher.py --default --client --host localhost --port 49965 "c:\Users\v.ganugapati\Desktop\Varchala Machine Learning\Chatbot_v.01\TFExample.py" " ModuleNotFoundError: No module named 'numpy.core._multiarray_umath' ImportError: numpy.core.multiarray failed to import
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "", line 980, in _find_and_load
SystemError: <class '_frozen_importlib._ModuleLockManager'> returned a result with an error set
ImportError: numpy.core._multiarray_umath failed to import
ImportError: numpy.core.umath failed to import
2019-02-11 11:18:48.276548: F tensorflow/python/lib/core/bfloat16.cc:675] Check failed: PyBfloat16_Type.tp_base != nullptr
C:\Users\v.ganugapati\Desktop\Varchala Machine `Learning>
Code
`import tensorflow as tf import matplotlib as plt print(tf.VERSION) mnist = tf.keras.datasets.mnist #28*28 images of hand-written digits 0-9
(x_train, y_train),(x_test, y_test) = mnist.load_data() print(x_train[0]) plt.imshow(x_train[0],cmap=plt.cm.binary) plt.show() print(y_train[0]) x_train = tf.keras.utils.normalize(x_train, axis=1) x_test = tf.keras.utils.normalize(x_test, axis=1) print(x_train[0])
plt.imshow(x_train[0],cmap=plt.cm.binary) plt.show() model = tf.keras.models.Sequential() model.add(tf.keras.layers.Flatten()) model.add(tf.keras.layers.Dense(128, activation=tf.nn.relu)) model.add(tf.keras.layers.Dense(128, activation=tf.nn.relu)) model.add(tf.keras.layers.Dense(10, activation=tf.nn.softmax)) model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy']) model.fit(x_train, y_train, epochs=3) val_loss, val_acc = model.evaluate(x_test, y_test) print(val_loss) print(val_acc)
`