FCHD-Fully-Convolutional-Head-Detector
FCHD-Fully-Convolutional-Head-Detector copied to clipboard
TypeError, when i run train.py
hello, i have trouble in training model when i run python train.py it seems that something wrong in trainer.py (forward function) what the problem is and how to solve it Thanks for helping
Traceback (most recent call last): File "train.py", line 132, in
train() File "train.py", line 107, in train _, _, _ = trainer.train_step(img, bbox, scale) File "trainer.py", line 66, in train_step losses, rois, rois_scores = self.forward(imgs, bboxes, scale) File "trainer.py", line 40, in forward rpn_locs, rpn_scores, rois, rois_scores, anchor = self.head_detector.rpn(features, img_size, scale) File "/home/zhouhongli/.conda/envs/torch-py27/lib/python2.7/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, **kwargs) File "src/region_proposal_network.py", line 79, in forward scale=scale File "src/creator_tool.py", line 135, in call keep = np.where((hs >= min_size) & (ws >= min_size))[0] TypeError: le() received an invalid combination of arguments - got (numpy.ndarray), but expected one of: (Tensor other) didn't match because some of the arguments have invalid types: (numpy.ndarray) (Number other) didn't match because some of the arguments have invalid types: (numpy.ndarray)
keep = np.where((hs >= min_size) & (ws >= min_size))[0]
Maybe something wrong in this code
I have same problem, have you solved it?
add this code 'min_size=np.array(min_size)' before 'keep = np.where((hs >= min_size) & (ws >= min_size))[0]'
@KelvinHuang666 It worked! Thank you so much!