简体   繁体   English

(0) 未知:获取卷积算法失败。 这可能是因为 cuDNN 未能初始化

[英](0) Unknown: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize

Here i am using mask_rcnn for object detection.这里我使用 mask_rcnn 进行 object 检测。 The code was functioning without error but now I am getting the following error.代码运行正常,但现在我收到以下错误。

code:代码:

Testing - 1
# 1 - 200 images testing
# Load a random image from the images folder
file_names = next(os.walk(IMAGE_DIR))[2]
i=0


for fn in file_names:

    #image = skimage.io.imread(os.path.join(IMAGE_DIR, random.choice(file_names)))
    i = i+1
    print(i)

    image = skimage.io.imread(os.path.join(IMAGE_DIR, fn))

    # Run detection
    results = model.detect([image], verbose=1)

    # Visualize results
    r = results[0]

    visualize.display_instances(image, r['rois'], r['masks'], r['class_ids'], 
                            class_names, r['scores'])

error message:错误信息:
1 Processing 1 images image shape: (1123, 1588, 3) min: 13.00000 max: 255.00000 uint8 molded_images shape: (1, 1024, 1024, 3) min: -123.70000 max: 150.10000 float64 image_metas shape: (1, 15) min: 0.00000 max: 1588.00000 float64 anchors shape: (1, 261888, 4) min: -0.35390 max: 1.29134 float32 --------------------------------------------------------------------------- UnknownError Traceback (most recent call last) in 15 16 # Run detection ---> 17 results = model.detect([image], verbose=1) 18 19 # Visualize results 1 处理 1 个图像图像形状:(1123, 1588, 3) 最小:13.00000 最大:255.00000 uint8 模塑图像形状:(1, 1024, 1024, 3) 最小:-123.70000 最大:150.10000 float64 image_metas 形状:(1, 15) 最小: 0.00000 最大值: 1588.00000 float64 锚形状: (1, 261888, 4) 最小值: -0.35390 最大值: 1.29134 float32 -------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - 未知错误Traceback (most recent call last) in 15 16 # 运行检测 ---> 17 results = model.detect([image], verbose=1) 18 19 # 可视化结果

D:\gpu\projects1\Mask_RCNN-Multi-Class-Detection\model.py in detect(self, images, verbose)
   2529         # Run object detection
   2530         detections, _, _, mrcnn_mask, _, _, _ =\
-> 2531             self.keras_model.predict([molded_images, image_metas, anchors], verbose=0)
   2532         # Process detections
   2533         results = []

~\Anaconda3\envs\tf-gpu\lib\site-packages\keras\engine\training.py in predict(self, x, batch_size, verbose, steps, callbacks, max_queue_size, workers, use_multiprocessing)
   1399                                             verbose=verbose,
   1400                                             steps=steps,
-> 1401                                             callbacks=callbacks)
   1402 
   1403     def train_on_batch(self, x, y,

~\Anaconda3\envs\tf-gpu\lib\site-packages\keras\engine\training_arrays.py in predict_loop(model, f, ins, batch_size, verbose, steps, callbacks)
    330             batch_logs = {'batch': batch_index, 'size': len(batch_ids)}
    331             callbacks._call_batch_hook('predict', 'begin', batch_index, batch_logs)
--> 332             batch_outs = f(ins_batch)
    333             batch_outs = to_list(batch_outs)
    334             if batch_index == 0:

~\Anaconda3\envs\tf-gpu\lib\site-packages\keras\backend\tensorflow_backend.py in __call__(self, inputs)
   2977                     return self._legacy_call(inputs)
   2978 
-> 2979             return self._call(inputs)
   2980         else:
   2981             if py_any(is_tensor(x) for x in inputs):

~\Anaconda3\envs\tf-gpu\lib\site-packages\keras\backend\tensorflow_backend.py in _call(self, inputs)
   2935             fetched = self._callable_fn(*array_vals, run_metadata=self.run_metadata)
   2936         else:
-> 2937             fetched = self._callable_fn(*array_vals)
   2938         return fetched[:len(self.outputs)]
   2939 

~\Anaconda3\envs\tf-gpu\lib\site-packages\tensorflow\python\client\session.py in __call__(self, *args, **kwargs)
   1456         ret = tf_session.TF_SessionRunCallable(self._session._session,
   1457                                                self._handle, args,
-> 1458                                                run_metadata_ptr)
   1459         if run_metadata:
   1460           proto_data = tf_session.TF_GetBuffer(run_metadata_ptr)

UnknownError: 2 root error(s) found.
  (0) Unknown: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.
     [[{{node conv1/convolution}}]]
     [[mrcnn_detection/map/TensorArrayUnstack/range/_4207]]
  (1) Unknown: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.
     [[{{node conv1/convolution}}]]
0 successful operations.
0 derived errors ignored.

You have to check that you have the right version of CUDA + CUDNN + TensorFlow(also ensure that you have all installed.您必须检查您是否拥有正确的 CUDA + CUDNN + TensorFlow 版本(还要确保您已全部安装。

Two examples of running configurations are presented below下面给出了两个运行配置的示例

Eg.例如。 Cuda 10 + CuDNN 7.6.3 + TensorFlow 1.13/1.14 works. Cuda 10 + CuDNN 7.6.3 + TensorFlow 1.13/1.14 工作。

Eg2 Cuda 9 + CuDNN 7.0.5 + TensorFlow 1.10 works例如2 Cuda 9 + CuDNN 7.0.5 + TensorFlow 1.10 作品

Eg3 Cuda 10.1 + CuDNN 7.6.5 + TensorFlow 2.1 works例如3 Cuda 10.1 + CuDNN 7.6.5 + TensorFlow 2.1 作品

Usually this error appears when you have an incompatible version of TensorFlow/CuDNN installed.当您安装了不兼容的 TensorFlow/CuDNN 版本时,通常会出现此错误。 In my case, this appeared when I tried using an older TensorFlow with a newer version of CuDNN.就我而言,当我尝试使用较旧的 TensorFlow 和较新版本的 CuDNN 时,就会出现这种情况。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 获取卷积算法失败。 这可能是因为 cuDNN 初始化失败, - Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, cuDNN 错误 无法获得卷积算法。 这可能是因为 cuDNN 初始化失败 - cuDNN Error Failed to get convolution algorithm. This is probably because cuDNN failed to initialize 无法创建 cudnn 句柄:CUDNN_STATUS_ALLOC_FAILED,无法获得卷积算法。 这可能是因为 cuDNN 未能初始化 - Could not create cudnn handle: CUDNN_STATUS_ALLOC_FAILED , Failed to get convolution algorithm. This is probably because cuDNN failed to initialize Tensorflow 错误。 获取卷积算法失败。 这可能是因为 cuDNN 未能初始化 - Tensorflow error. Failed to get convolution algorithm. This is probably because cuDNN failed to initialize CUDA Tensorflow 版本,nvidia-smi 版本问题。 获取卷积算法失败。 这可能是因为 cuDNN 初始化失败, - CUDA Tensorflow Version ,nvidia-smi version issue. Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, 获取卷积算法失败。 这可能是因为 cuDNN 初始化失败,所以尝试查看是否打印了警告日志消息 - Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed Google Colab 错误:无法获得卷积算法。这可能是因为 cuDNN 初始化失败 - Google Colab Error : Failed to get convolution algorithm.This is probably because cuDNN failed to initialize CNN error Failed to get convolution algorithm.这可能是因为cuDNN初始化失败, - CNN error Failed to get convolution algorithm.This is probably because cuDNN failed to initialize, 获取卷积算法失败。这可能是因为cuDNN初始化失败。[{node conv2d_1/Conv2D}] - Failed to get convolution algorithm.This is probably because cuDNN failed to initialize.[{node conv2d_1/Conv2D}] 获取卷积算法失败。 在 Tensorflow 图像识别中 - Failed to get convolution algorithm. In Tensorflow Image Recognition
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM