amdegroot/ssd.pytorch

'float' object is not subscriptable during running eval.py

pjg205 opened this issue · 0 comments

Hi, I use this code, but I don't know the reason why it happens.
Is there any one who experienced this like me? If the problem was solved, let me know the way to solve please.

Traceback (most recent call last):
File "eval.py", line 437, in
test_net(args.save_folder, net, args.cuda, dataset,
File "eval.py", line 386, in test_net
detections = net(x).data
File "/opt/conda/envs/prac/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/data/SSD.Pytorch/ssd.py", line 105, in forward
output = self.detect.apply(17, 0, 200, 0.01, 0.45,
File "/data/SSD.Pytorch/layers/functions/detection.py", line 60, in forward
decoded_boxes = decode(loc_data[i], prior_data, self.variance)
File "/data/SSD.Pytorch/layers/box_utils.py", line 154, in decode
priors[:, :2] + loc[:, :2] * variances[0] * priors[:, 2:],
TypeError: 'float' object is not subscriptable