ShaoDu 2019-03-02 19:04 采纳率: 0%
浏览 342

slim微调后的模型可以用在tf-faster rcnn上进行细粒度测试吗?

这是用在tf-faster rcnn上的错误

Traceback (most recent call last):
  File "/home/lf/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1322, in _do_call
    return fn(*args)
  File "/home/lf/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1307, in _run_fn
    options, feed_dict, fetch_list, target_list, run_metadata)
  File "/home/lf/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1409, in _call_tf_sessionrun
    run_metadata)
tensorflow.python.framework.errors_impl.NotFoundError: Key resnet_v1_101/bbox_pred/biases not found in checkpoint
     [[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "../tools/demo.py", line 189, in <module>
    print(saver.restore(sess,tfmodel))
  File "/home/lf/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1768, in restore
    six.reraise(exception_type, exception_value, exception_traceback)
  File "/home/lf/anaconda3/lib/python3.6/site-packages/six.py", line 693, in reraise
    raise value
  File "/home/lf/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1752, in restore
    {self.saver_def.filename_tensor_name: save_path})
  File "/home/lf/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 900, in run
    run_metadata_ptr)
  File "/home/lf/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1135, in _run
    feed_dict_tensor, options, run_metadata)
  File "/home/lf/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1316, in _do_run
    run_metadata)
  File "/home/lf/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1335, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.NotFoundError: Key resnet_v1_101/bbox_pred/biases not found in checkpoint
     [[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]

Caused by op 'save/RestoreV2', defined at:
  File "../tools/demo.py", line 187, in <module>
    saver = tf.train.Saver()
  File "/home/lf/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1284, in __init__
    self.build()
  File "/home/lf/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1296, in build
    self._build(self._filename, build_save=True, build_restore=True)
  File "/home/lf/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1333, in _build
    build_save=build_save, build_restore=build_restore)
  File "/home/lf/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 781, in _build_internal
    restore_sequentially, reshape)
  File "/home/lf/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 400, in _AddRestoreOps
    restore_sequentially)
  File "/home/lf/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 832, in bulk_restore
    return io_ops.restore_v2(filename_tensor, names, slices, dtypes)
  File "/home/lf/anaconda3/lib/python3.6/site-packages/tensorflow/python/ops/gen_io_ops.py", line 1463, in restore_v2
    shape_and_slices=shape_and_slices, dtypes=dtypes, name=name)
  File "/home/lf/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
    op_def=op_def)
  File "/home/lf/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3414, in create_op
    op_def=op_def)
  File "/home/lf/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1740, in __init__
    self._traceback = self._graph._extract_stack()  # pylint: disable=protected-access

NotFoundError (see above for traceback): Key resnet_v1_101/bbox_pred/biases not found in checkpoint
     [[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]

  • 写回答

1条回答 默认 最新

  • 你知我知皆知 2024-08-08 03:43
    关注

    以下回答参考 皆我百晓生券券喵儿 等免费微信小程序相关内容作答,并由本人整理回复。

    可以的。然而,根据您提供的信息,我无法确定如何使用Slim微调后的模型来运行TF-Faster R-CNN细粒度测试。因为Slim是一个轻量级深度学习框架,通常用于快速构建和训练简单的神经网络,而TF-Faster R-CNN是一个更复杂的计算机视觉任务(例如物体检测)的框架。

    为了将Slim微调后的模型应用于TF-Faster R-CNN,可能需要对模型结构进行一些修改或重新设计以适应特定的任务需求。这包括但不限于调整层的数量、添加新的层或者改变层之间的连接方式等。

    此外,您还需要确保您的模型已经通过了适当的验证和测试,并且具有足够的泛化能力,以便能够正确地执行细粒度测试。

    总之,要使用Slim微调后的模型来进行细粒度测试,您需要首先熟悉Slim框架以及TF-Faster R-CNN,然后对其进行必要的修改或重新设计。

    评论

报告相同问题?