![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
keras
ZAX130
新人博主
展开
-
[经验日记]tensorflow的一种广播机制
[经验日记]tensorflow的一种广播机制问题:将shape=(2,)维的Tensor A和shape=(2,2,2)的Tensor B以某种方式相乘,这里它们的第一个维度2代表Batch_size, A可以理解为sigmoid输出, B为两张2x2的图像分割结果,要将A中的数分别对应乘上B中的图片(先验二分类)A = tf.constant([1,2])B = tf.constant([ [ [1,0], [0,1] ], [原创 2021-04-14 10:00:45 · 183 阅读 · 0 评论 -
【Mnist】用matplotlib查看Mnist数据集中的图片(由keras导入的数据集)
【Mnist】用matplotlib查看Mnist数据集中的图片(由keras导入的数据集)8行代码:import numpy as npimport matplotlib.pyplot as pltfrom keras.datasets import mnist (X_train, Y_train), (Y_test, Y_test) = mnist.load_data() #...原创 2019-07-11 00:20:43 · 1283 阅读 · 0 评论 -
keras报错 ValueError: Shape must be rank 1 but is rank 0 for 'bn_conv1/Reshape_4' (op: 'Reshape') 不用降级
问题:ValueError: Shape must be rank 1 but is rank 0 for ‘bn_conv1/Reshape_4’ (op: ‘Reshape’) with input shapes: [1,1,1,64], [].情况:1.keras是2.2.4版本(keras-gpu),后端为tensorflow2.你在用channels_first且用了bn层(不是用...原创 2019-08-04 23:12:49 · 627 阅读 · 0 评论