keras - 当我训练模型时,我不断在 F-RCNN 中遇到这些错误
问题描述
当我在其间运行它 1000 个 epoch 时,它也会给出类似的异常,并且在它完成 1000 个 epoch 之后,它会继续迭代这些相同的异常。该模型的 Github 代码 - https://github.com/bhatt-priyadutt/blink-rate
Exception: 2 root error(s) found.
(0) Invalid argument: slice index 2 of dimension 1 out of bounds.
[[node roi_pooling_conv_1/strided_slice_13 (defined at usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/ops.py:1748) ]]
[[add_22/_305]]
(1) Invalid argument: slice index 2 of dimension 1 out of bounds.
[[node roi_pooling_conv_1/strided_slice_13 (defined at usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/ops.py:1748) ]]
0 successful operations.
0 derived errors ignored.
Original stack trace for 'roi_pooling_conv_1/strided_slice_13':
File "content/blink-rate/train_frcnn.py", line 134, in <module>
classifier = nn.classifier(shared_layers, roi_input, C.num_rois, nb_classes=len(classes_count), trainable=True)
File "content/blink-rate/keras_frcnn/resnet.py", line 239, in classifier
out_roi_pool = RoiPoolingConv(pooling_regions, num_rois)([base_layers, input_rois])
File "usr/local/lib/python3.7/dist-packages/keras/engine/topology.py", line 578, in __call__
output = self.call(inputs, **kwargs)
File "content/blink-rate/keras_frcnn/RoiPoolingConv.py", line 65, in call
h = rois[0, roi_idx, 3]
File "usr/local/lib/python3.7/dist-packages/tensorflow_core/python/ops/array_ops.py", line 802, in _slice_helper
name=name)
File "usr/local/lib/python3.7/dist-packages/tensorflow_core/python/ops/array_ops.py", line 968, in strided_slice
shrink_axis_mask=shrink_axis_mask)
File "usr/local/lib/python3.7/dist-packages/tensorflow_core/python/ops/gen_array_ops.py", line 10392, in strided_slice
shrink_axis_mask=shrink_axis_mask, name=name)
File "usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/op_def_library.py", line 794, in _apply_op_helper
op_def=op_def)
File "usr/local/lib/python3.7/dist-packages/tensorflow_core/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/ops.py", line 3357, in create_op
attrs, op_def, compute_device)
File "usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/ops.py", line 3426, in _create_op_internal
op_def=op_def)
File "usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/ops.py", line 1748, in __init__
self._traceback = tf_stack.extract_stack()
Exception: index 1000 is out of bounds for axis 0 with size 1000
Exception: index 1000 is out of bounds for axis 0 with size 1000
Exception: index 1000 is out of bounds for axis 0 with size 1000
2021-09-26 15:41:01.791109: W tensorflow/core/framework/op_kernel.cc:1651] OP_REQUIRES failed at strided_slice_op.cc:108 : Invalid argument: slice index 6 of dimension 1 out of bounds.
2021-09-26 15:41:01.791144: W tensorflow/core/framework/op_kernel.cc:1651] OP_REQUIRES failed at strided_slice_op.cc:108 : Invalid argument: slice index 4 of dimension 1 out of bounds.
解决方案
推荐阅读
- python - 如何将 python 变量传递给对 sed 的子进程调用?
- html - css 网格使用 fr 增长超过 100% 的宽度,但没有使用 minmax
- c# - 从分块请求中获取响应
- node.js - 执行 npm install 命令时出现“npm ERR!file bashcls”
- python - 如何在literal_eval之前用Python AST中的dict替换OrderedDict?
- python - Python One-hot 对文本中的每 2 个字符进行一次编码
- accurev - 将 AccuRev 事务中的所有文件与父流版本进行比较
- javascript - jquery on drop 功能不起作用
- python - Tkinter 不使用 Pycharm
- java - How does Collections.unmodifiableList (Java 8 SE) get modified when making a new ArrayList from it?