AITTSMD / MTCNN-Tensorflow

Reproduce MTCNN using Tensorflow
1.51k stars 713 forks source link

generate_bbox报错 #283

Closed ZouDongj closed 5 years ago

ZouDongj commented 5 years ago

我在将模型转化为pb模型并尝试加载的时候,程序在处理到generate_bbox的时候报错

File "test.py", line 104, in generate_bbox
    reg])
  File "/root/anaconda3/envs/chineseocr/lib/python3.6/site-packages/numpy/core/shape_base.py", line 234, in vstack
    return _nx.concatenate([atleast_2d(_m) for _m in tup], 0)
ValueError: all the input array dimensions except for the concatenation axis must match exactly

对应的代码:

reg = np.array([dx1, dy1, dx2, dy2])
score = cls_map[t_index[0], t_index[1]]
boundingbox = np.vstack([np.round((stride * t_index[1]) / scale),
                                            np.round((stride * t_index[0]) / scale),
                                            np.round((stride * t_index[1] + cellsize) / scale),
                                            np.round((stride * t_index[0] + cellsize) / scale),
                                            score,
                                            reg])

这里np.vstack里面array的shape是不是不统一啊,还是说我模型加载的有问题呢?