- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
嗨,我在做 tensorflow object detection api
.我已经按照 repo 中的所有主要说明进行操作,直到现在它一直运行良好。但是突然开始出现一些奇怪的错误。我正在使用 fast rcnn
之前和现在切换到 ssd mobile v2 coco
.
使用命令生成推理图时
python export_inference_graph.py --input_type image_tensor --pipeline_config_path training/faster_rcnn_inception_v2_pets.config --trained_checkpoint_prefix training/model.ckpt-10250 --output_directory inference_graph
Traceback (most recent call last): File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1356, in _do_call return fn(*args) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1341, in _run_fn options, feed_dict, fetch_list, target_list, run_metadata) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1429, in _call_tf_sessionrun run_metadata) tensorflow.python.framework.errors_impl.NotFoundError: Key Conv/biases not found in checkpoint [[{{node save/RestoreV2}}]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1286, in restore {self.saver_def.filename_tensor_name: save_path}) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 950, in run run_metadata_ptr) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1173, in _run feed_dict_tensor, options, run_metadata) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1350, in _do_run run_metadata) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1370, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.NotFoundError: Key Conv/biases not found in checkpoint [[node save/RestoreV2 (defined at /home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/object_detection/exporter.py:331) ]]
Original stack trace for 'save/RestoreV2': File "export_inference_graph.py", line 162, in tf.app.run() File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 40, in run _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/absl/app.py", line 299, in run _run_main(main, args) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/absl/app.py", line 250, in _run_main sys.exit(main(argv)) File "export_inference_graph.py", line 158, in main write_inference_graph=FLAGS.write_inference_graph) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/object_detection/exporter.py", line 497, in export_inference_graph write_inference_graph=write_inference_graph) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/object_detection/exporter.py", line 426, in _export_inference_graph trained_checkpoint_prefix=checkpoint_to_use) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/object_detection/exporter.py", line 331, in write_graph_and_checkpoint tf.import_graph_def(inference_graph_def, name='') File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func return func(*args, **kwargs) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 443, in import_graph_def _ProcessNewOps(graph) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 236, in _ProcessNewOps for new_op in graph._add_new_tf_operations(compute_devices=False): # pylint: disable=protected-access File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3751, in _add_new_tf_operations for c_op in c_api_util.new_tf_operations(self) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3751, in for c_op in c_api_util.new_tf_operations(self) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3641, in _create_op_from_tf_operation ret = Operation(c_op, self) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2005, in init self._traceback = tf_stack.extract_stack()
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1296, in restore names_to_keys = object_graph_key_mapping(save_path) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1614, in object_graph_key_mapping object_graph_string = reader.get_tensor(trackable.OBJECT_GRAPH_PROTO_KEY) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 678, in get_tensor return CheckpointReader_GetTensor(self, compat.as_bytes(tensor_str)) tensorflow.python.framework.errors_impl.NotFoundError: Key _CHECKPOINTABLE_OBJECT_GRAPH not found in checkpoint
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "export_inference_graph.py", line 162, in tf.app.run() File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 40, in run _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/absl/app.py", line 299, in run _run_main(main, args) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/absl/app.py", line 250, in _run_main sys.exit(main(argv)) File "export_inference_graph.py", line 158, in main write_inference_graph=FLAGS.write_inference_graph) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/object_detection/exporter.py", line 497, in export_inference_graph write_inference_graph=write_inference_graph) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/object_detection/exporter.py", line 426, in _export_inference_graph trained_checkpoint_prefix=checkpoint_to_use) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/object_detection/exporter.py", line 335, in write_graph_and_checkpoint saver.restore(sess, trained_checkpoint_prefix) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1302, in restore err, "a Variable name or other graph key that is missing") tensorflow.python.framework.errors_impl.NotFoundError: Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key that is missing from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:
Key Conv/biases not found in checkpoint [[node save/RestoreV2 (defined at /home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/object_detection/exporter.py:331) ]]
Original stack trace for 'save/RestoreV2': File "export_inference_graph.py", line 162, in tf.app.run() File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 40, in run _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/absl/app.py", line 299, in run _run_main(main, args) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/absl/app.py", line 250, in _run_main sys.exit(main(argv)) File "export_inference_graph.py", line 158, in main write_inference_graph=FLAGS.write_inference_graph) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/object_detection/exporter.py", line 497, in export_inference_graph write_inference_graph=write_inference_graph) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/object_detection/exporter.py", line 426, in _export_inference_graph trained_checkpoint_prefix=checkpoint_to_use) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/object_detection/exporter.py", line 331, in write_graph_and_checkpoint tf.import_graph_def(inference_graph_def, name='') File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func return func(*args, **kwargs) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 443, in import_graph_def _ProcessNewOps(graph) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 236, in _ProcessNewOps for new_op in graph._add_new_tf_operations(compute_devices=False): # pylint: disable=protected-access File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3751, in _add_new_tf_operations for c_op in c_api_util.new_tf_operations(self) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3751, in for c_op in c_api_util.new_tf_operations(self) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3641, in _create_op_from_tf_operation ret = Operation(c_op, self) File "/home/user/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2005, in init self._traceback = tf_stack.extract_stack()
# Faster R-CNN with Inception v2, configured for Oxford-IIIT Pets Dataset.
# Users should configure the fine_tune_checkpoint field in the train config as
# well as the label_map_path and input_path fields in the train_input_reader and
# eval_input_reader. Search for "PATH_TO_BE_CONFIGURED" to find the fields that
# should be configured.
model {
faster_rcnn {
num_classes: 2
image_resizer {
keep_aspect_ratio_resizer {
min_dimension: 600
max_dimension: 1024
}
}
feature_extractor {
type: 'faster_rcnn_inception_v2'
first_stage_features_stride: 16
}
first_stage_anchor_generator {
grid_anchor_generator {
scales: [0.25, 0.5, 1.0, 2.0]
aspect_ratios: [0.5, 1.0, 2.0]
height_stride: 16
width_stride: 16
}
}
first_stage_box_predictor_conv_hyperparams {
op: CONV
regularizer {
l2_regularizer {
weight: 0.0
}
}
initializer {
truncated_normal_initializer {
stddev: 0.01
}
}
}
first_stage_nms_score_threshold: 0.0
first_stage_nms_iou_threshold: 0.7
first_stage_max_proposals: 300
first_stage_localization_loss_weight: 2.0
first_stage_objectness_loss_weight: 1.0
initial_crop_size: 14
maxpool_kernel_size: 2
maxpool_stride: 2
second_stage_box_predictor {
mask_rcnn_box_predictor {
use_dropout: false
dropout_keep_probability: 1.0
fc_hyperparams {
op: FC
regularizer {
l2_regularizer {
weight: 0.0
}
}
initializer {
variance_scaling_initializer {
factor: 1.0
uniform: true
mode: FAN_AVG
}
}
}
}
}
second_stage_post_processing {
batch_non_max_suppression {
score_threshold: 0.0
iou_threshold: 0.6
max_detections_per_class: 100
max_total_detections: 300
}
score_converter: SOFTMAX
}
second_stage_localization_loss_weight: 2.0
second_stage_classification_loss_weight: 1.0
}
}
train_config: {
batch_size: 1
optimizer {
momentum_optimizer: {
learning_rate: {
manual_step_learning_rate {
initial_learning_rate: 0.0002
schedule {
step: 1
learning_rate: .0002
}
schedule {
step: 900000
learning_rate: .00002
}
schedule {
step: 1200000
learning_rate: .000002
}
}
}
momentum_optimizer_value: 0.9
}
use_moving_average: false
}
gradient_clipping_by_norm: 10.0
fine_tune_checkpoint: "/home/user/Downloads/Data_Science/Git/models/research/object_detection/faster_rcnn_inception_v2_coco_2018_01_28/model.ckpt"
from_detection_checkpoint: true
load_all_detection_checkpoint_vars: false
# Note: The below line limits the training process to 200K steps, which we
# empirically found to be sufficient enough to train the pets dataset. This
# effectively bypasses the learning rate schedule (the learning rate will
# never decay). Remove the below line to train indefinitely.
num_steps: 200000
data_augmentation_options {
random_horizontal_flip {
}
}
}
train_input_reader: {
tf_record_input_reader {
input_path: "/home/user/Downloads/Data_Science/Git/models/research/object_detection/train.record"
}
label_map_path: "/home/user/Downloads/Data_Science/Git/models/research/object_detection/training/labelmap.pbtxt"
}
eval_config: {
num_examples: 67
# Note: The below line limits the evaluation process to 10 evaluations.
# Remove the below line to evaluate indefinitely.
max_evals: 10
}
eval_input_reader: {
tf_record_input_reader {
input_path: "C:/tensorflow1/models/research/object_detection/test.record"
}
label_map_path: "C:/tensorflow1/models/research/object_detection/training/labelmap.pbtxt"
shuffle: false
num_readers: 1
}
最佳答案
你确定你的型号training/model.ckpt-10250
是 faster_rcnn_inception_v2_pets
模型?错误 NotFoundError: Key Conv/biases not found in checkpoint [[{{node save/RestoreV2}}]]
表示它无法恢复 Conv/biases
从检查站。
或者,确保您使用的是对象检测框架支持的 TF 版本。您可以找到所有版本 here .
关于python - 在 tensorlfow 对象检测 api 中导出推理图时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59268278/
SQLite、Content provider 和 Shared Preference 之间的所有已知区别。 但我想知道什么时候需要根据情况使用 SQLite 或 Content Provider 或
警告:我正在使用一个我无法完全控制的后端,所以我正在努力解决 Backbone 中的一些注意事项,这些注意事项可能在其他地方更好地解决......不幸的是,我别无选择,只能在这里处理它们! 所以,我的
我一整天都在挣扎。我的预输入搜索表达式与远程 json 数据完美配合。但是当我尝试使用相同的 json 数据作为预取数据时,建议为空。点击第一个标志后,我收到预定义消息“无法找到任何内容...”,结果
我正在制作一个模拟 NHL 选秀彩票的程序,其中屏幕右侧应该有一个 JTextField,并且在左侧绘制弹跳的选秀球。我创建了一个名为 Ball 的类,它实现了 Runnable,并在我的主 Draf
这个问题已经有答案了: How can I calculate a time span in Java and format the output? (18 个回答) 已关闭 9 年前。 这是我的代码
我有一个 ASP.NET Web API 应用程序在我的本地 IIS 实例上运行。 Web 应用程序配置有 CORS。我调用的 Web API 方法类似于: [POST("/API/{foo}/{ba
我将用户输入的时间和日期作为: DatePicker dp = (DatePicker) findViewById(R.id.datePicker); TimePicker tp = (TimePic
放宽“邻居”的标准是否足够,或者是否有其他标准行动可以采取? 最佳答案 如果所有相邻解决方案都是 Tabu,则听起来您的 Tabu 列表的大小太长或您的释放策略太严格。一个好的 Tabu 列表长度是
我正在阅读来自 cppreference 的代码示例: #include #include #include #include template void print_queue(T& q)
我快疯了,我试图理解工具提示的行为,但没有成功。 1. 第一个问题是当我尝试通过插件(按钮 1)在点击事件中使用它时 -> 如果您转到 Fiddle,您会在“内容”内看到该函数' 每次点击都会调用该属
我在功能组件中有以下代码: const [ folder, setFolder ] = useState([]); const folderData = useContext(FolderContex
我在使用预签名网址和 AFNetworking 3.0 从 S3 获取图像时遇到问题。我可以使用 NSMutableURLRequest 和 NSURLSession 获取图像,但是当我使用 AFHT
我正在使用 Oracle ojdbc 12 和 Java 8 处理 Oracle UCP 管理器的问题。当 UCP 池启动失败时,我希望关闭它创建的连接。 当池初始化期间遇到 ORA-02391:超过
关闭。此题需要details or clarity 。目前不接受答案。 想要改进这个问题吗?通过 editing this post 添加详细信息并澄清问题. 已关闭 9 年前。 Improve
引用这个plunker: https://plnkr.co/edit/GWsbdDWVvBYNMqyxzlLY?p=preview 我在 styles.css 文件和 src/app.ts 文件中指定
为什么我的条形这么细?我尝试将宽度设置为 1,它们变得非常厚。我不知道还能尝试什么。默认厚度为 0.8,这是应该的样子吗? import matplotlib.pyplot as plt import
当我编写时,查询按预期执行: SELECT id, day2.count - day1.count AS diff FROM day1 NATURAL JOIN day2; 但我真正想要的是右连接。当
我有以下时间数据: 0 08/01/16 13:07:46,335437 1 18/02/16 08:40:40,565575 2 14/01/16 22:2
一些背景知识 -我的 NodeJS 服务器在端口 3001 上运行,我的 React 应用程序在端口 3000 上运行。我在 React 应用程序 package.json 中设置了一个代理来代理对端
我面临着一个愚蠢的问题。我试图在我的 Angular 应用程序中延迟加载我的图像,我已经尝试过这个2: 但是他们都设置了 src attr 而不是 data-src,我在这里遗漏了什么吗?保留 d
我是一名优秀的程序员,十分优秀!