我想使用Keras实现这个神经网络:
尝试运行以下命令时:
model_All_CNN = Sequential()
# input: 126*126 images with 3 channels -> (126, 126, 3) tensors.
# this applies 320 convolution filters of size 2*2 each.
act = keras.layers.advanced_activations.LeakyReLU(alpha=0.3)
# This returns a tensor
#input_img = Input(shape=(3 ,126, 126))
conv1 = model_All_CNN.add(Conv2D(320, (2, 2), strides=(1, 1), activation=act,input_shape= (128,128,3)))
model_All_CNN.add(Activation(act))
我收到以下错误:
File "/Users/M.I.T/anaconda/envs/Mulimediaassignment/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py",
line 2856, in conv2d
x = tf.nn.convolution(
AttributeError: module 'tensorflow.python.ops.nn' has no attribute 'convolution'