FCHD-Fully-Convolutional-Head-Detector icon indicating copy to clipboard operation
FCHD-Fully-Convolutional-Head-Detector copied to clipboard

TypeError, when i run train.py

Open Rayholle opened this issue 6 years ago • 4 comments

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 avatar Apr 11 '19 14:04 Rayholle

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

Rayholle avatar Apr 11 '19 14:04 Rayholle

I have same problem, have you solved it?

lianyaohao avatar Apr 22 '19 05:04 lianyaohao

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

KelvinHuang666 avatar Apr 28 '19 00:04 KelvinHuang666

@KelvinHuang666 It worked! Thank you so much!

RaidenCJ avatar May 09 '19 10:05 RaidenCJ