tensorflow2.0使用自带的函数求精准率和召回率(解决Shapes (None, 10) and (None, 1) are incompatible)
本代码使用的是cifar10数据集,所以有十个类别废话不多说,直接给代码吧importtensorflowastffromtensorflow.kerasimportdatasets,Sequential,layers,metrics(x_train,y_train),_=datasets.cifar10.load_data()defprocession(x,y):x=tf.cast(x,dtyp