【问题标题】:TensorFlow training data Error. ValueErrorTensorFlow 训练数据错误。值错误
【发布时间】:2019-01-16 00:32:36
【问题描述】:

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

ValueError:model_config 不是 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.`

【问题讨论】:

  • 我认为是版本问题,后来python3增加了对ObjectDetection模型的支持,可能重新安装Tensorflow可以解决这个问题。
  • 你用的是什么版本的tensorflow?
  • 我使用的是 1.9 版。我应该更新它吗?
  • 我会试试的。感谢您的回复
  • 发现它是使用 python2 的组合,我的计算机将配置文件转换为带有字体和其他奇怪东西的原始文本。再次感谢您的帮助

标签: python python-3.x tensorflow valueerror


【解决方案1】:

在我的电脑上,我做了这些并解决了这个问题:

model_builder.py,不要使用

from protos import model_pb2

使用

from object_detection.protos import model_pb2

改为。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-03-19
    • 2020-06-14
    • 2018-07-28
    • 1970-01-01
    • 2016-08-09
    • 1970-01-01
    • 2018-01-01
    • 2017-01-08
    相关资源
    最近更新 更多