使用Tensorflow训练目标检测模块

时间:2020-09-23 19:46:07

标签: python tensorflow

当我执行以下命令来使用tenserflow训练模型时,出现了以下错误。

命令

python legacy/train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config

错误

D:\Anaconda\envs\tf1.12\lib\site-packages\tensorflow\python\framework\dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
D:\Anaconda\envs\tf1.12\lib\site-packages\tensorflow\python\framework\dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
D:\Anaconda\envs\tf1.12\lib\site-packages\tensorflow\python\framework\dtypes.py:528: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
D:\Anaconda\envs\tf1.12\lib\site-packages\tensorflow\python\framework\dtypes.py:529: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
D:\Anaconda\envs\tf1.12\lib\site-packages\tensorflow\python\framework\dtypes.py:530: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
D:\Anaconda\envs\tf1.12\lib\site-packages\tensorflow\python\framework\dtypes.py:535: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])
Traceback (most recent call last):
  File "legacy/train.py", line 51, in <module>
    from object_detection.builders import dataset_builder
  File "D:\tf1.12\model\research\object_detection\builders\dataset_builder.py", line 32, in <module>
    from object_detection.builders import decoder_builder
  File "D:\tf1.12\model\research\object_detection\builders\decoder_builder.py", line 25, in <module>
    from object_detection.data_decoders import tf_example_decoder
  File "D:\tf1.12\model\research\object_detection\data_decoders\tf_example_decoder.py", line 28, in <module>
    from tf_slim import tfexample_decoder as slim_example_decoder
ModuleNotFoundError: No module named 'tf_slim'

那么,我该如何解决?

1 个答案:

答案 0 :(得分:0)

可能 tf-slim 软件包未安装在您的python环境中。尝试在conda提示符下运行以下命令

pip install tf-slim