错误1
See tf.nn.softmax_cross_entropy_with_logits_v2.
Traceback (most recent call last):
File “D:\software\PyCharm\helpers\pydev\pydevd.py”, line 1668, in
main()
File “D:\software\PyCharm\helpers\pydev\pydevd.py”, line 1662, in main
globals = debugger.run(setup[‘file’], None, None, is_module)
File “D:\software\PyCharm\helpers\pydev\pydevd.py”, line 1072, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File “D:\software\PyCharm\helpers\pydev_pydev_imps_pydev_execfile.py”, line 18, in execfile
exec(compile(contents+”\n”, file, ‘exec’), glob, loc)
File “E:/tensorflow-relevant-download/light_dection/object_detection/train.py”, line 196, in
tf.app.run()
File “D:\software\Anaconda\envs\py3\lib\site-packages\tensorflow\python\platform\app.py”, line 124, in run
_sys.exit(main(argv))
File “E:/tensorflow-relevant-download/light_dection/object_detection/train.py”, line 192, in main
worker_job_name, is_chief, FLAGS.train_dir)
File “E:\tensorflow-relevant-download\light_dection\object_detection\trainer.py”, line 255, in train
train_config.optimizer)
File “E:\tensorflow-relevant-download\light_dection\object_detection\builders\optimizer_builder.py”, line 50, in build
learning_rate = _create_learning_rate(config.learning_rate)
File “E:\tensorflow-relevant-download\light_dection\object_detection\builders\optimizer_builder.py”, line 108, in _create_learning_rate
learning_rate_sequence)
File “E:\tensorflow-relevant-download\light_dection\object_detection\utils\learning_schedules.py”, line 153, in manual_stepping
tf.constant(range(num_boundaries), dtype=tf.int32),
File “D:\software\Anaconda\envs\py3\lib\site-packages\tensorflow\python\framework\constant_op.py”, line 212, in constant
value, dtype=dtype, shape=shape, verify_shape=verify_shape))
File “D:\software\Anaconda\envs\py3\lib\site-packages\tensorflow\python\framework\tensor_util.py”, line 413, in make_tensor_proto
_AssertCompatible(values, dtype)
File “D:\software\Anaconda\envs\py3\lib\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.
解决方案 :
make sure which object_detection module do you use before change
Expected float32, got range(0, 3) of type ‘range’ instead. #17209
https://github.com/tensorflow/tensorflow/issues/17209
explicitely create list from range() for python3 compatibility #3442
https://github.com/tensorflow/models/pull/3442/commits/c9592aa60134b457bcb8acba4cea434485494010
https://github.com/tensorflow/models/issues/3443
solution
object_detection\utils\learning_schedules.py 153
tf.constant(list(range(num_boundaries)), dtype=tf.int32),
错误2 :x and y must have the same dtype, got tf.float32 != tf.int32
解决方案 :
object_detection\core\losses.py 301
self._logit_scale = tf.cast(self._logit_scale, tf.float32) # TODO change : Add cast to float to avoid devid error