Faster R-CNN,TensorFlow版本训练过程中出现:keep_inds = np.append(fg_inds, bg_inds) (Pdb)

Faster R-CNN,TensorFlow版本训练过程中出现:keep_inds = np.append(fg_inds, bg_inds) (Pdb)


> /data/sam.yi/Image_manipulation_detection/lib/layer_utils/proposal_target_layer.py(139)_sample_rois()
-> keep_inds = np.append(fg_inds, bg_inds)
(Pdb) 
(Pdb) 
(Pdb) 
(Pdb) 
(Pdb)

解决方法:

参考 https://github.com/dBeker/Faster-RCNN-TensorFlow-Python3/issues/31中的几种方法

  1. 修改config.py中的两个阈值:
    tf.app.flags.DEFINE_float(‘roi_bg_threshold_high’, 0.5, “Overlap threshold for a ROI to be considered background (class = 0 if overlap in [LO, HI))”)
    tf.app.flags.DEFINE_float(‘roi_bg_threshold_low’, 0.1, “Overlap threshold for a ROI to be considered background (class = 0 if overlap in [LO, HI))”)
    将两个值0.5设置为0.3,0.1设置为0.0。

  2. 修改lr学习率,0.1降为0.0001

  3. 修改SCALES,比如: SCALES = [1,2,4,8,16], RATIOS = [0.5,1,2]

  4. 修改pascal_voc.py中的四行代码,将-1去掉

x1 = float(bbox.find('xmin').text) - 1
y1 = float(bbox.find('ymin').text
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
没有GPU,优化程序class point_cloud_generator(): def init(self, rgb_file, depth_file, save_ply, camera_intrinsics=[312.486, 243.928, 382.363, 382.363]): self.rgb_file = rgb_file self.depth_file = depth_file self.save_ply = save_ply self.rgb = cv2.imread(rgb_file) self.depth = cv2.imread(self.depth_file, -1) print("your depth image shape is:", self.depth.shape) self.width = self.rgb.shape[1] self.height = self.rgb.shape[0] self.camera_intrinsics = camera_intrinsics self.depth_scale = 1000 def compute(self): t1 = time.time() depth = np.asarray(self.depth, dtype=np.uint16).T self.Z = depth / self.depth_scale fx, fy, cx, cy = self.camera_intrinsics X = np.zeros((self.width, self.height)) Y = np.zeros((self.width, self.height)) for i in range(self.width): X[i, :] = np.full(X.shape[1], i) self.X = ((X - cx / 2) * self.Z) / fx for i in range(self.height): Y[:, i] = np.full(Y.shape[0], i) self.Y = ((Y - cy / 2) * self.Z) / fy data_ply = np.zeros((6, self.width * self.height)) data_ply[0] = self.X.T.reshape(-1)[:self.width * self.height] data_ply[1] = -self.Y.T.reshape(-1)[:self.width * self.height] data_ply[2] = -self.Z.T.reshape(-1)[:self.width * self.height] img = np.array(self.rgb, dtype=np.uint8) data_ply[3] = img[:, :, 0:1].reshape(-1)[:self.width * self.height] data_ply[4] = img[:, :, 1:2].reshape(-1)[:self.width * self.height] data_ply[5] = img[:, :, 2:3].reshape(-1)[:self.width * self.height] self.data_ply = data_ply t2 = time.time() print('calcualte 3d point cloud Done.', t2 - t1) def write_ply(self): start = time.time() float_formatter = lambda x: "%.4f" % x points = [] for i in self.data_ply
最新发布
05-24

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值