【问题标题】:error while running tensorflow object detection api with faster_rcnn_inception_v2_pets model使用 faster_rcnn_inception_v2_pets 模型运行 tensorflow 对象检测 api 时出错
【发布时间】:2018-03-17 06:25:19
【问题描述】:

我已成功使用 ssd_mobilenet 模型进行 tensorflow 对象检测 API。 当我尝试使用 faster_rcnn_inception_v2_pets 时,会出现以下错误。

    Traceback (most recent call last):
  File "train.py", line 167, in <module>
    tf.app.run()
  File "/home/chamod/anaconda3/envs/tensorflow-new/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 124, in run
    _sys.exit(main(argv))
  File "train.py", line 163, in main
    worker_job_name, is_chief, FLAGS.train_dir)
  File "/home/chamod/champ/new-project-v2/models/object_detection/trainer.py", line 255, in train
    train_config.optimizer)
  File "/home/chamod/champ/new-project-v2/models/object_detection/builders/optimizer_builder.py", line 50, in build
    learning_rate = _create_learning_rate(config.learning_rate)
  File "/home/chamod/champ/new-project-v2/models/object_detection/builders/optimizer_builder.py", line 108, in _create_learning_rate
    learning_rate_sequence)
  File "/home/chamod/champ/new-project-v2/models/object_detection/utils/learning_schedules.py", line 153, in manual_stepping
    tf.constant(range(num_boundaries), dtype=tf.int32),
  File "/home/chamod/anaconda3/envs/tensorflow-new/lib/python3.5/site-packages/tensorflow/python/framework/constant_op.py", line 212, in constant
    value, dtype=dtype, shape=shape, verify_shape=verify_shape))
  File "/home/chamod/anaconda3/envs/tensorflow-new/lib/python3.5/site-packages/tensorflow/python/framework/tensor_util.py", line 413, in make_tensor_proto
    _AssertCompatible(values, dtype)
  File "/home/chamod/anaconda3/envs/tensorflow-new/lib/python3.5/site-packages/tensorflow/python/framework/tensor_util.py", line 328, in _AssertCompatible
    (dtype.name, repr(mismatch), type(mismatch).__name__))
TypeError: Expected int32, got range(0, 3) of type 'range' instead.

faster_rcnn_inception_v2_pets.config 文件中是否有任何特定的更改?

【问题讨论】:

    标签: python-3.x tensorflow object-detection tensorflow-datasets


    【解决方案1】:

    您可以如下修改相关文件。

    第 153 行:tf.constant(range(num_boundaries), dtype=tf.int32), to tf.constant(list(range(num_boundaries)), dtype=tf.int32),

    这是一个 python 问题,因为 range 不是列表。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-04-16
      • 1970-01-01
      • 1970-01-01
      • 2018-05-20
      • 2018-03-30
      • 2020-11-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多