TypeError Traceback (most recent call last) in 1 model= tf.keras.models.Sequential() ----> 2 model.add(Conv3D(64 ,kernel_size =(3,3,3) ,strides = (1,1,1), padding = 'same',input_shape=(input_shape) ,activation = 'relu')) 3 model.add(Conv3D(64 , kernel_size = (3,3,3) ,strides = (1,1,1) , padding = 'same' , activation = 'relu')) 4 model.add(MaxPooling3D(pooling_size = (2,2,2) , strides= (2,2,2))) 5 model.add(Conv3D(128 , kernel_size = (3,3,3) ,strides = (1,1,1) , padding = 'same' , activation = 'relu'))
Asked
Active
Viewed 625 times
1 Answers
1
You are using tf.keras
while you have added Conv3D
layer from keras.layers.convolutional.Conv3D
.
Change your layer import to:
from tensorflow.keras.layers import Conv3D

Vivek Mehta
- 2,612
- 2
- 18
- 30
-
again its shows an error File "
", line 4 from tensorflow.keras.layers import Conv3D, ^ SyntaxError: trailing comma not allowed without surrounding parentheses – 985674123 Feb 07 '20 at 14:45 -
model.add(tf.keras.layers.layers.Dropout(0.25)) error :module 'tensorflow.keras.layers' has no attribute 'layers' for dropout layer – 985674123 Feb 08 '20 at 08:02
-
You really need to read [TF documentation](https://www.tensorflow.org/api_docs) and go through some [python](https://docs.python.org/3/tutorial/) tutorials first. – Vivek Mehta Feb 08 '20 at 08:24