Python “我如何解决?”;cuda 2D conv问题;?

Python “我如何解决?”;cuda 2D conv问题;?,python,tensorflow,keras,Python,Tensorflow,Keras,这是我的代码,但预测功能不起作用 错误: 我该怎么办?? wekfjeojocwjcopjcoekcopejcpoejpoekcpejjocijewjwrjwihujviruhviuhr错误在于未能使用卷积算法。不确定所有可能导致此错误的因素,但当我遇到此错误时,这是因为我有多个使用tensorflow的python实例正在运行。因此,在jupyter笔记本中,除了要运行的笔记本之外,请禁用所有python open笔记本的内核。您可能希望将错误代码粘贴为纯文本(而不是屏幕截图),以便于人们帮

这是我的代码,但预测功能不起作用

错误:

我该怎么办??
wekfjeojocwjcopjcoekcopejcpoejpoekcpejjocijewjwrjwihujviruhviuhr

错误在于未能使用卷积算法。不确定所有可能导致此错误的因素,但当我遇到此错误时,这是因为我有多个使用tensorflow的python实例正在运行。因此,在jupyter笔记本中,除了要运行的笔记本之外,请禁用所有python open笔记本的内核。

您可能希望将错误代码粘贴为纯文本(而不是屏幕截图),以便于人们帮助您。
from keras.applications.vgg16 import VGG16
from keras.utils.vis_utils import plot_model
#Keras will download the weight files from the Internet and store them in the ~/.keras/models directory.
model = VGG16()

from keras.preprocessing.image import load_img
from keras.preprocessing.image import img_to_array
from keras.applications.vgg16 import preprocess_input
# load an image from file
image = load_img('output.png', target_size=(224, 224))

# convert the image pixels to a numpy array
image = img_to_array(image)
# reshape data for the model
image = image.reshape((1, image.shape[0], image.shape[1], image.shape[2]))

# prepare the image for the VGG model
image = preprocess_input(image)


from keras.applications.vgg16 import decode_predictions
import matplotlib.pyplot as plt
import numpy as np
from PIL import Image
# predict the probability across all output classes
yhat = model.predict(image)
# convert the probabilities to class labels
label = decode_predictions(yhat)
# retrieve the most likely result, e.g. highest probability
label = label[0][0]
# print the classification
print('%s (%.2f%%)' % (label[1], label[2]*100))
img = Image.open('output.png')
plt.imshow(img)