Не удалось получить алгоритм свертки. В Tensorflow Распознавание изображений - PullRequest
1 голос
/ 14 марта 2020

Я пытаюсь создать детектор объектов, который использует модель тензорного потока для распознавания изображений, но я не могу заставить его работать из-за этой ошибки. Я новичок в графических процессорах, поэтому подробная помощь будет высоко оценена.

----> 2   show_inference(detection_model, image_path)
<ipython-input-15-e474e557b383> in show_inference(model, image_path)
      4   image_np = np.array(Image.open(image_path))
      5   # Actual detection.
----> 6   output_dict = run_inference_for_single_image(model, image_np)
      7   # Visualization of the results of a detection.
      8   vis_util.visualize_boxes_and_labels_on_image_array(
<ipython-input-14-4110867dcb70> in run_inference_for_single_image(model, image)
      7 
      8   # Run inference
----> 9   output_dict = model(input_tensor)
     10 
     11   # All outputs are batches tensors.
D:\python\lib\site-packages\tensorflow_core\python\eager\function.py in __call__(self, *args, **kwargs)
   1549       TypeError: For invalid positional/keyword argument combinations.
   1550     """
-> 1551     return self._call_impl(args, kwargs)
   1552 
   1553   def _call_impl(self, args, kwargs, cancellation_manager=None):
D:\python\lib\site-packages\tensorflow_core\python\eager\function.py in _call_impl(self, args, kwargs, cancellation_manager)
   1589       raise TypeError("Keyword arguments {} unknown. Expected {}.".format(
   1590           list(kwargs.keys()), list(self._arg_keywords)))
-> 1591     return self._call_flat(args, self.captured_inputs, cancellation_manager)
   1592 
   1593   def _filtered_call(self, args, kwargs):
D:\python\lib\site-packages\tensorflow_core\python\eager\function.py in _call_flat(self, args, captured_inputs, cancellation_manager)
   1690       # No tape is watching; skip to running the function.
   1691       return self._build_call_outputs(self._inference_function.call(
-> 1692           ctx, args, cancellation_manager=cancellation_manager))
   1693     forward_backward = self._select_forward_and_backward_functions(
   1694         args,
D:\python\lib\site-packages\tensorflow_core\python\eager\function.py in call(self, ctx, args, cancellation_manager)
    543               inputs=args,
    544               attrs=("executor_type", executor_type, "config_proto", config),
--> 545               ctx=ctx)
    546         else:
    547           outputs = execute.execute_with_cancellation(
D:\python\lib\site-packages\tensorflow_core\python\eager\execute.py in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name)
     65     else:
     66       message = e.message
---> 67     six.raise_from(core._status_to_exception(e.code, message), None)
     68   except TypeError as e:
     69     keras_symbolic_tensors = [
~\AppData\Roaming\Python\Python37\site-packages\six.py in raise_from(value, from_value)
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 FeatureExtractor/MobilenetV1/MobilenetV1/Conv2d_0/BatchNorm/batchnorm/mul_1 (defined at <ipython-input-7-f8a3c92a04a4>:11) ]]
     [[Postprocessor/BatchMultiClassNonMaxSuppression/mul/_54]]
  (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 FeatureExtractor/MobilenetV1/MobilenetV1/Conv2d_0/BatchNorm/batchnorm/mul_1 (defined at <ipython-input-7-f8a3c92a04a4>:11) ]]
0 successful operations.
0 derived errors ignored. [Op:__inference_pruned_16996]
Function call stack:
pruned -> pruned

У меня есть версия tesorflow: 2.1.0

Версия Cuda: 10.2

Версия CUDNN: 7.6.5

1 Ответ

0 голосов
/ 16 марта 2020

Я тоже столкнулся с этой проблемой. Я не уверен в причине, но я подозреваю, что это как-то связано с памятью GPU. Я замечаю, что получаю эту ошибку, когда у меня слишком много запущенных экземпляров python. Ошибка исчезает, когда я убиваю другие python экземпляры. Так что попробуйте только с одним экземпляром python. У меня также была похожая проблема, когда я установил Tensorflow 2 с помощью pip. Если ошибка не устранена, удалите Tensorflow 2 и переустановите его с помощью Conda. Conda устанавливает все графические зависимости CUDA и CUDNN автоматически.

...