tensorflow v2 object detection ValueError 问题

tensorflow v2 object detection ValueError 问题

背景

近期项目需求,再次上手tf的API,顺便升级到了V2。

Windows10 下训练时发现报了这么个错误:

Traceback (most recent call last):
  File "D:\Anaconda3\lib\site-packages\absl\app.py", line 299, in run
    _run_main(main, args)
  File "D:\Anaconda3\lib\site-packages\absl\app.py", line 250, in _run_main
    sys.exit(main(argv))
  File "E:/datasets/DCMCIS/rubbish/model_main_tf2.py", line 103, in main
    use_tpu=FLAGS.use_tpu)
  File "D:\Anaconda3\lib\site-packages\object_detection\model_lib_v2.py", line 554, in train_loop
    unpad_groundtruth_tensors)
  File "D:\Anaconda3\lib\site-packages\object_detection\model_lib_v2.py", line 335, in load_fine_tune_checkpoint
    if not is_object_based_checkpoint(checkpoint_path):
  File "D:\Anaconda3\lib\site-packages\object_detection\model_lib_v2.py", line 298, in is_object_based_checkpoint
    var_names = [var[0] for var in tf.train.list_variables(checkpoint_path)]
  File "D:\Anaconda3\lib\site-packages\tensorflow\python\training\checkpoint_utils.py", line 98, in list_variables
    reader = load_checkpoint(ckpt_dir_or_file)
  File "D:\Anaconda3\lib\site-packages\tensorflow\python\training\checkpoint_utils.py", line 67, in load_checkpoint
    return py_checkpoint_reader.NewCheckpointReader(filename)
  File "D:\Anaconda3\lib\site-packages\tensorflow\python\training\py_checkpoint_reader.py", line 95, in NewCheckpointReader
    return CheckpointReader(compat.as_bytes(filepattern))
ValueError

解决方法

修改config文件,将fine_tune_checkpoint中的\全部改为/

©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页