当我尝试运行此代码时:
# the array based representation of the image will be used later in order to prepare the
# result image with boxes and labels on it.
image_np = np.array(Image.open(image_path))
# Actual detection.
output_dict = run_inference_for_single_image(model, image_np)
# Visualization of the results of a detection.
vis_util.visualize_boxes_and_labels_on_image_array(
image_np,
output_dict['detection_boxes'],
output_dict['detection_classes'],
output_dict['detection_scores'],
category_index,
instance_masks=output_dict.get('detection_masks_reframed', None),
use_normalized_coordinates=True,
line_thickness=8)
display(Image.fromarray(image_np))
for image_path in TEST_IMAGE_PATHS:
show_inference(detection_model, image_path)
由于某些原因,它始终显示“内核似乎已死亡。它将自动重新启动。”
以前,我能够运行此代码。.但现在它继续显示内核已死亡
我尝试使用conda update mkl更新环境
从(源或二进制)安装的TensorFlow: 使用pip安装(pip install tensorflow-gpu) TF版本:2.0 繁殖方法: 运行object_detection_tutorial.ipynb文件