i use jupyter notebook with anaconda, my problem happen when i run the code below
#####################
classes=7
model = create_convolutional_model(classes)
model.summary()
######################
AttributeError Traceback (most recent call last)
in
1 classes=7
----> 2 model = create_convolutional_model(classes)
3 model.summary()
in create_convolutional_model(classes)
1 def create_convolutional_model(classes):
2 model = Sequential()
----> 3 model.add(Conv2D(32,kernel_size=(2,2),strides=(1,1),activation='relu',input_shape=(48,48,1)))
4 model.add(BatchNormalization())
5 model.add(MaxPooling2D(pool_size=(2,2),strides=(2,2)))
~\anaconda3\envs\tf\lib\site-packages\keras\engine\sequential.py in add(self, layer)
164 # and create the node connecting the current layer
165 # to the input layer we just created.
--> 166 layer(x)
167 set_inputs = True
168 else:
~\anaconda3\envs\tf\lib\site-packages\keras\backend\tensorflow_backend.py in symbolic_fn_wrapper(*args, **kwargs)
73 if _SYMBOLIC_SCOPE.value:
74 with get_graph().as_default():
---> 75 return func(*args, **kwargs)
76 else:
77 return func(*args, **kwargs)
~\anaconda3\envs\tf\lib\site-packages\keras\engine\base_layer.py in call(self, inputs, **kwargs)
444 # Raise exceptions in case the input is not compatible
445 # with the input_spec specified in the layer constructor.
--> 446 self.assert_input_compatibility(inputs)
447
448 # Collect input shapes to build layer.
~\anaconda3\envs\tf\lib\site-packages\keras\engine\base_layer.py in assert_input_compatibility(self, inputs)
308 for x in inputs:
309 try:
--> 310 K.is_keras_tensor(x)
311 except ValueError:
312 raise ValueError('Layer ' + self.name + ' was called with '
~\anaconda3\envs\tf\lib\site-packages\keras\backend\tensorflow_backend.py in is_keras_tensor(x)
693 ```
694 """
--> 695 if not is_tensor(x):
696 raise ValueError('Unexpectedly found an instance of type ' + 697 str(type(x)) + '
. '
~\anaconda3\envs\tf\lib\site-packages\keras\backend\tensorflow_backend.py in is_tensor(x)
701
702 def is_tensor(x):
--> 703 return isinstance(x, tf_ops._TensorLike) or tf_ops.is_dense_tensor_like(x)
704
705
AttributeError: module 'tensorflow.python.framework.ops' has no attribute '_TensorLike'