Can anyone tell me why this error is displayed

this is a python code error
Traceback (most recent call last):

File “”, line 1, in
runfile(‘C:/Users/Prisilla/Desktop/Semantics/Pri_seman_1.py’, wdir=‘C:/Users/Prisilla/Desktop/Semantics’)

File “C:\Users\Prisilla\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py”, line 692, in runfile
execfile(filename, namespace)

File “C:\Users\Prisilla\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py”, line 101, in execfile
exec(compile(f.read(), filename, ‘exec’), namespace)

File “C:/Users/Prisilla/Desktop/Semantics/Pri_seman_1.py”, line 8, in
from keras_contrib.applications import densenet

File “C:\Users\Prisilla\Anaconda3\lib\site-packages\keras_contrib__init__.py”, line 4, in
from . import layers

File “C:\Users\Prisilla\Anaconda3\lib\site-packages\keras_contrib\layers__init__.py”, line 7, in
from .convolutional import *

File “C:\Users\Prisilla\Anaconda3\lib\site-packages\keras_contrib\layers\convolutional.py”, line 15, in
from keras.utils.conv_utils import normalize_data_format
ImportError: cannot import name ‘normalize_data_format’’

Hey, great to have you here! :slight_smile:

It seems like it could not import ‘normalize_data_format’ properly. Could you provide a code snippet in order to help you out through this issue. 

Thanks 

Yes! it is resolving by creating a virtual environment

but now when i run any python code

i am getting the error as

  File “C:\Users\Prisilla\Anaconda3\lib\site-packages\tensorflow\python__init__.py”, line 52, in <module>
    from tensorflow.core.framework.graph_pb2 import *

  File “C:\Users\Prisilla\Anaconda3\lib\site-packages\tensorflow\core\framework\graph_pb2.py”, line 15, in <module>
    from tensorflow.core.framework import node_def_pb2 as tensorflow_dot_core_dot_framework_dot_node__def__pb2

  File “C:\Users\Prisilla\Anaconda3\lib\site-packages\tensorflow\core\framework\node_def_pb2.py”, line 15, in <module>
    from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2

  File “C:\Users\Prisilla\Anaconda3\lib\site-packages\tensorflow\core\framework\attr_value_pb2.py”, line 15, in <module>
    from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2

  File “C:\Users\Prisilla\Anaconda3\lib\site-packages\tensorflow\core\framework\tensor_pb2.py”, line 16, in <module>
    from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2

  File “C:\Users\Prisilla\Anaconda3\lib\site-packages\tensorflow\core\framework\tensor_shape_pb2.py”, line 22, in <module>
    serialized_pb=_b(’\n,tensorflow/core/framework/tensor_shape.proto\x12\ntensorflow"z\n\x10TensorShapeProto\x12-\n\x03\x64im\x18\x02 \x03(\x0b\x32 .tensorflow.TensorShapeProto.Dim\x12\x14\n\x0cunknown_rank\x18\x03 \x01(\x08\x1a!\n\x03\x44im\x12\x0c\n\x04size\x18\x01 \x01(\x03\x12\x0c\n\x04name\x18\x02 \x01(\tBq\n\x18org.tensorflow.frameworkB\x11TensorShapeProtosP\x01Z=github.com/tensorflow/tensorflow/tensorflow/go/core/framework\xf8\x01\x01\x62\x06proto3’)

actually it was showing for the file resource_handle_pb2.py

File “C:\Users\Prisilla\Anaconda3\lib\site-packages\tensorflow\core\framework\resource_handle_pb2.py”, line 22, in
serialized_pb=_b(’\n/tensorflow/core/framework/resource_handle.proto\x12\ntensorflow"m\n\x0eResourceHandle\x12\x0e\n\x06\x64\x65vice\x18\x01 \x01(\t\x12\x11\n\tcontainer\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x11\n\thash_code\x18\x04 \x01(\x04\x12\x17\n\x0fmaybe_type_name\x18\x05 \x01(\tB4\n\x18org.tensorflow.frameworkB\x13ResourceHandleProtoP\x01\xf8\x01\x01\x62\x06proto3’)

I was running a program when i got error in resource_handle_pb2.py .
so i edited it now again resource_handle_pb2.py is not working.
i tried downloading from https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/makefile/Makefile#L544
resource_handle_pb2.py

but it is not working .
Can i know from where i can get the original (contents) file of resource_handle_pb2.py

I am uninstalling the anaconda and python and will reinstall it again.