Python TensorFlow训练数据错误。数值误差

Python TensorFlow训练数据错误。数值误差,python,python-3.x,tensorflow,valueerror,Python,Python 3.x,Tensorflow,Valueerror,我目前正在做一个tensorflow项目,我得到了这个错误 ValueError:model_配置不是model_pb2.DetectionModel类型 当我试着训练我的模特时就会发生这种情况。以前有人遇到过这个问题吗?第一个问题在这里提出,所以要温柔 `Chinatowns-MacBook-Air:object_detection nathangrant$ python3 train.py --logtostderr --train_dir=training/ --pipeline_conf

我目前正在做一个tensorflow项目,我得到了这个错误

ValueError:model_配置不是model_pb2.DetectionModel类型

当我试着训练我的模特时就会发生这种情况。以前有人遇到过这个问题吗?第一个问题在这里提出,所以要温柔

`Chinatowns-MacBook-Air:object_detection nathangrant$ python3 train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/ssd_mobilenet_v1_pets.config
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: compiletime version 3.5 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.7
  return f(*args, **kwds)
WARNING:tensorflow:From /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/platform/app.py:48: main (from __main__) is deprecated and will be removed in a future version.
Instructions for updating:
Use object_detection/model_main.py.
Traceback (most recent call last):
  File "train.py", line 184, in <module>
    tf.app.run()
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tensorflow/python/util/deprecation.py", line 136, in new_func
    return func(*args, **kwargs)
  File "train.py", line 180, in main
    graph_hook_fn=graph_rewriter_fn)
  File "/Users/nathangrant/Downloads/models-master/research/object_detection/legacy/trainer.py", line 245, in train
    detection_model = create_model_fn()
  File "/Users/nathangrant/Downloads/models-master/research/object_detection/builders/model_builder.py", line 105, in build
    raise ValueError('model_config not of type model_pb2.DetectionModel.')
ValueError: model_config not of type model_pb2.DetectionModel.`
唐人街MacBook Air:object\u detection nathangrant$python3 train.py--logtostderr--train\u dir=training/--pipeline\u config\u path=training/ssd\u mobilenet\u v1\u pets.config /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219:RuntimeWarning:compiletime模块“tensorflow.Python.framework.fast_tensor_util”的版本3.5与运行时版本3.7不匹配 返回f(*args,**kwds) 警告:tensorflow:From/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site packages/tensorflow/Python/platform/app.py:48:main(From _u_umain_uu_u_u____________。 更新说明: 使用object\u detection/model\u main.py。 回溯(最近一次呼叫最后一次): 文件“train.py”,第184行,在 tf.app.run() 文件“/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site packages/tensorflow/Python/platform/app.py”,第48行,运行中 _系统出口(主(_sys.argv[:1]+标志_passthrough)) 文件“/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site packages/tensorflow/Python/util/deprecation.py”,第136行,在new_func中 返回函数(*args,**kwargs) 文件“train.py”,第180行,在main中 图\u钩子\u fn=图\u重写器\u fn) 文件“/Users/nathangrant/Downloads/models master/research/object_detection/legacy/trainer.py”,第245行,列车中 检测\模型=创建\模型\ fn() 文件“/Users/nathangrant/Downloads/models master/research/object_detection/builders/model_builder.py”,第105行,内部版本 raise VALUEMERROR('model_config不是model_pb2.DetectionModel'类型) ValueError:model_配置不是model_pb2.DetectionModel类型`
在我的计算机中,我完成了以下操作并修复了此问题:

model_builder.py
中,不要使用

from protos import model_pb2
使用


相反。

我认为这是版本问题,对ObjectDetection模型的支持后来被添加到python3中,也许新安装的Tensorflow可以解决这个问题。您使用的是什么版本的Tensorflow?我使用的是1.9版。我应该更新吗?我试试看。感谢您的回复。我发现这是使用python2和我的计算机将配置文件转换为带有字体和其他奇怪内容的原始文本的组合。再次感谢你的帮助
from object_detection.protos import model_pb2