Tensorflow 2目标检测不起作用?

2024-06-16 12:31:43 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图在Tensorflow 2中训练一个目标检测模型。但自从我从1转到tensorflow 2,我似乎有问题。每当我开始训练的时候。我在以下github线程https://github.com/tensorflow/models/issues/9706中得到了相同的错误:

I have the same error if I use numpy 1.20.0 NotImplementedError: Cannot convert a symbolic Tensor (cond_2/strided_slice:0) to a numpy array.

if I use numpy 1.19.5 I get ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject

Tried with TF 2.2.2 as well in both cases same errors

唯一的区别是,当我将python更改为3.6时,得到的输出与上一条错误消息相同(我还使用了anaconda):

Traceback (most recent call last): File "model_main_tf2.py", line 31, in import tensorflow.compat.v2 as tf File "D:\Maurice_Doc\AI\anaconda3\envs\tensorflow\lib\site-packages\tensorflow_init_.py", line 41, in from tensorflow.python.tools import module_util as module_util File "D:\Maurice_Doc\AI\anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python_init.py", line 39, in from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow File "D:\Maurice_Doc\AI\anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 83, in raise ImportError(msg) ImportError: Traceback (most recent call last): File "D:\Maurice_Doc\AI\anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in from tensorflow.python._pywrap_tensorflow_internal import

  • ImportError: DLL load failed: The specified module could not be found.

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/errors

for some common reasons and solutions. Include the entire stack trace above this error message when asking for help.

我已在以下位置学习了本教程: https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/training.html

从开始到结束,在我学习TensorFlow 1x教程时,它一直有效,但由于某些原因,由于他们切换到TensorFlow 2x,我遇到了很多问题

有人知道如何解决这个问题吗


Tags: infrompyimportnumpydoctensorflowas