啊啊啊啊啊吖

2019-01-28   阅读量: 1940

数据分析师 Python数据分析

我该怎么做才能解决这个错误?

扫码加入数据分析学习群

我在这里附加了我的代码。它完全没有任何错误地学习,但是当我想在lambda层之后显示层的输出时,它会产生这个错误。

InvalidArgumentError:您必须为占位符张量'input_78'提供一个值,其中dtype为float和shape [?,28,28,1] [[{{node input_78}} = Placeholderdtype = DT_FLOAT,shape = [?,28,28,1 ],_ device =“/ job:localhost / replica:0 / task:0 / device:GPU:0”]] [[{{node lambda_35 / add / _2359}} = _Recvclient_terminated = false,recv_device =“/ job:localhost / replica:0 / task:0 / device:CPU:0“,send_device =”/ job:localhost / replica:0 / task:0 / device:GPU:0“,send_device_incarnation = 1,tensor_name =”edge_50_lambda_35 / add“ ,tensor_type = DT_FLOAT,_device =“/ job:localhost / replica:0 / task:0 / device:CPU:0”]]

我之前实现了这段代码而没有添加w_expanded作为fit函数的输入,它显示输出没有错误,但是使用这段代码,它产生了上面提到的错误。我不明白为什么它显示这个错误?请帮我。我真的需要解决方案。

添加CDA认证专家【维克多阿涛】,微信号:【cdashijiazhuang】,提供数据分析指导及CDA考试秘籍。已助千人通过CDA数字化人才认证。欢迎交流,共同成长!
0.0000 0 4 关注作者 收藏

评论(1)

啊啊啊啊啊吖
2019-01-28

X = x_test[i:i+1]

# Visualize weights

W = model.layers[1].get_weights()[0][:,:,0,:]

w1=W.reshape(16,3,3)

W = np.squeeze(w1)

print("W shape : ", W.shape)

for i in range(0,16):

plt.subplot(4,4,i+1)

plt.imshow(w1[i,:,:], interpolation='nearest',cmap='gray')

plt.show()

W = model.layers[2].get_weights()[0][:,:,0,:]

w2=W.reshape(8,3,3)

W = np.squeeze(w2)

print("W shape : ", W.shape)

for i in range(0,8):

plt.subplot(4,4,i+1)

plt.imshow(w2[i,:,:], interpolation='nearest',cmap='gray')

plt.show()

0.0000 0 0 回复

推荐课程