将SSD7实现转换为keras.tf的问题

时间:2019-08-23 11:03:55

标签: python machine-learning tf.keras

我们按照以下步骤实现了目标,

  1. 我们转换了以下内容
import tensorflow as tf
from tensorflow.python.keras.optimizers import Adam
from tensorflow.python.keras.callbacks import ModelCheckpoint, EarlyStopping, ReduceLROnPlateau, TerminateOnNaN, CSVLogger
from tensorflow.python.keras import backend as K
from tensorflow.python.keras.models import load_model
  1. 然后,我们在_keras_layer_AnchorBoxes.py_文件中发现了一个错误。在那里,我们更改了以下几行
[173]box_height = self.this_scale * size // np.sqrt(ar)
[180]batch_size, feature_map_height, feature_map_width, feature_map_channels = x._shape_val
[182]batch_size, feature_map_channels, feature_map_height, feature_map_width = x._shape_val
[188]step_height = self.img_height // feature_map_height
[189]step_width = self.img_width // feature_map_width
[274]boxes_tensor, dtype='int32'), (K.shape(x)[0], 1, 1, 1, 1))

我们陷入了错误

TypeError: in converted code:

    c:\Users\akilap\Desktop\Sprint 10\New folder\ssd_object_detection\SSD7-tf\keras_layers\keras_layer_AnchorBoxes.py:209 call *
        cy = np.linspace(offset_height * step_height, (offset_height +
    C:\Users\akilap\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\framework\tensor_shape.py:438 __rmul__
        return self * other

    TypeError: unsupported operand type(s) for *: 'Dimension' and 'float'

如果您能帮助我们,那将是一个很大的帮助!

谢谢。

0 个答案:

没有答案