使用 faster_rcnn_inception_v2_pets 模型 运行 tensorflow 对象检测 api 时出错
error while running tensorflow object detection api with faster_rcnn_inception_v2_pets model
我已成功使用 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 文件中是否有任何具体更改?
您可以修改相关文件如下。
第 153 行:tf.constant(范围(num_boundaries),dtype=tf.int32),
到 tf.constant(列表(范围(num_boundaries)), dtype=tf.int32),
这是一个 python 问题,因为范围不是列表。
我已成功使用 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 文件中是否有任何具体更改?
您可以修改相关文件如下。
第 153 行:tf.constant(范围(num_boundaries),dtype=tf.int32), 到 tf.constant(列表(范围(num_boundaries)), dtype=tf.int32),
这是一个 python 问题,因为范围不是列表。