ValueError:Tensor Tensor(“ dense_2 / Softmax:0”,shape =(?, 36),dtype = float32)不是此图的元素

时间:2020-07-13 08:44:20

标签: python-3.x cv2

我已经训练了模型,但是当我尝试识别图像时,它出现了类似于标题的错误

def identify(image):
# result = platfinder(image)
# print('platfinder : ',result)
# image = 'plates/plate.jpg'
# print(image)
segmentation(image)
# print('segmentation : ')
imgSegmen = []
for img in os.listdir('charimg'):
# try:
    #manggil data
    image = cv2.imread(os.path.join('charimg',img),cv2.IMREAD_GRAYSCALE)
    # print(image.shape)
    imgSegmen.append(image)

imgSegmen = np.array(imgSegmen).reshape(-1,28,28,1)
print('ukuran',imgSegmen.shape)

with tf.Graph().as_default():
    results = loaded_model.predict(imgSegmen)

return results

0 个答案:

没有答案