【发布时间】:2017-10-13 08:26:47
【问题描述】:
在制作这样的 CNN 模型时:
# function to build model
def create_model(features):
with C.layers.default_options(init=C.glorot_uniform(), activation=C.LeakyReLU):
h = features
h = C.layers.Convolution2D(filter_shape=(5,5),
num_filters=8,
strides=(2,2),
pad=True, name='first_conv')(h)
h = C.layers.Convolution2D(filter_shape=(5,5),
num_filters=16,
strides=(2,2),
pad=True, name='second_conv')(h)
r = C.layers.Dense(num_output_classes, activation=None, name='classify')(h)
return r
# Create the model
z = create_model(x)
# Print the output shapes / parameters of different components
print("Output Shape of the first convolution layer:", z.first_conv.shape)
print("Bias value of the last dense layer:", z.classify.b.value)
我收到错误:
AttributeError Traceback(最近调用 最后)在() 1 # 创建模型 ----> 2 z = create_model(x) 3 4 # 打印不同组件的输出形状/参数 5 print("第一个卷积层的输出Shape:", z.first_conv.shape)
在 create_model(features) 2 3 def create_model(功能): ----> 4 与 C.layers.default_options(init=C.glorot_uniform(), activation=C.LeakyReLU): 5 小时 = 特征 6 h = C.layers.Convolution2D(filter_shape=(5,5),
AttributeError: 模块 'cntk' 没有属性 'LeakyReLU'
我是深度学习的新手,所以我可能会遗漏一些简单的东西。任何帮助表示赞赏。谢谢!
【问题讨论】:
标签: python machine-learning deep-learning cntk