title: 'TypeError: Expected a message Descriptor, got Descriptor' when trying to import keras
body: <p>I was trying to import this</p>
  <pre><code>from tensorflow.keras import Sequential
  from tensorflow.keras.layers import Conv2D, Flatten, Dense
  from tensorflow.keras.callbacks import EarlyStopping
  </code></pre>
  <p>I got this error:</p>
  <pre><code>---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-5-5869267b9269&gt; in &lt;module&gt;
  ----&gt; 1 from tensorflow.keras import Sequential
        2 from tensorflow.keras.layers import Conv2D, Flatten, Dense
        3 from tensorflow.keras.callbacks import EarlyStopping
  
  ~\Anaconda3\lib\site-packages\tensorflow\__init__.py in &lt;module&gt;
       26 
       27 # pylint: disable=g-bad-import-order
  ---&gt; 28 from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
       29 from tensorflow.python.tools import module_util as _module_util
       30 
  
  ~\Anaconda3\lib\site-packages\tensorflow\python\__init__.py in &lt;module&gt;
       50 
       51 # Protocol buffers
  ---&gt; 52 from tensorflow.core.framework.graph_pb2 import *
       53 from tensorflow.core.framework.node_def_pb2 import *
       54 from tensorflow.core.framework.summary_pb2 import *
  
  ~\Anaconda3\lib\site-packages\tensorflow\core\framework\graph_pb2.py in &lt;module&gt;
       14 
       15 
  ---&gt; 16 from tensorflow.core.framework import node_def_pb2 as tensorflow_dot_core_dot_framework_dot_node__def__pb2
       17 from tensorflow.core.framework import function_pb2 as tensorflow_dot_core_dot_framework_dot_function__pb2
       18 from tensorflow.core.framework import versions_pb2 as tensorflow_dot_core_dot_framework_dot_versions__pb2
  
  ~\Anaconda3\lib\site-packages\tensorflow\core\framework\node_def_pb2.py in &lt;module&gt;
       14 
       15 
  ---&gt; 16 from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2
       17 
       18 
  
  ~\Anaconda3\lib\site-packages\tensorflow\core\framework\attr_value_pb2.py in &lt;module&gt;
       14 
       15 
  ---&gt; 16 from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2
       17 from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2
       18 from tensorflow.core.framework import types_pb2 as tensorflow_dot_core_dot_framework_dot_types__pb2
  
  ~\Anaconda3\lib\site-packages\tensorflow\core\framework\tensor_pb2.py in &lt;module&gt;
       14 
       15 
  ---&gt; 16 from tensorflow.core.framework import resource_handle_pb2 as tensorflow_dot_core_dot_framework_dot_resource__handle__pb2
       17 from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2
       18 from tensorflow.core.framework import types_pb2 as tensorflow_dot_core_dot_framework_dot_types__pb2
  
  ~\Anaconda3\lib\site-packages\tensorflow\core\framework\resource_handle_pb2.py in &lt;module&gt;
       90 ResourceHandleProto = _reflection.GeneratedProtocolMessageType('ResourceHandleProto', (_message.Message,), dict(
       91   DESCRIPTOR = _RESOURCEHANDLEPROTO,
  ---&gt; 92   __module__ = 'tensorflow.core.framework.resource_handle_pb2'
       93   # @@protoc_insertion_point(class_scope:tensorflow.ResourceHandleProto)
       94   ))
  
  TypeError: Expected a message Descriptor, got Descriptor
  </code></pre>
  <p>I have accidentally no idea why it suddenly did this when it was fine before. I tried the solutions for those who experienced a 'expecting bytes' error to no avail. It also seems that no one had gotten this error before.</p>
  <p>Thank you so much for the help!</p>