aditya-vora / FCHD-Fully-Convolutional-Head-Detector

Code for FCHD - A fast and accurate head detector
Other
647 stars 182 forks source link

TypeError, when i run train.py #28

Open Rayholle opened 5 years ago

Rayholle commented 5 years ago

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)

Rayholle commented 5 years ago

keep = np.where((hs >= min_size) & (ws >= min_size))[0] Maybe something wrong in this code

lianyaohao commented 5 years ago

I have same problem, have you solved it?

KelvinHuang666 commented 5 years ago

add this code 'min_size=np.array(min_size)' before 'keep = np.where((hs >= min_size) & (ws >= min_size))[0]'

RaidenCJ commented 5 years ago

@KelvinHuang666 It worked! Thank you so much!