Rapternmn / PyTorch-Onnx-Tensorrt

A set of tool which would make your life easier with Tensorrt and Onnxruntime. This Repo is designed for YoloV3
80 stars 18 forks source link

TypeError: list indices must be integers or slices, not tuple #1

Closed AsharFatmi closed 4 years ago

AsharFatmi commented 4 years ago

Since there is no load_net in Darknet. I used

model = Darknet(cfgfile)
model.load_weights(weightfile)

in detect.py

I am getting an error in utils/utils.py ay line 311: conf_mask = (prediction[:,:,4] > confidence).float().unsqueeze(2)

detect.py:10: UserWarning: volatile was removed and now has no effect. Use `with torch.no_grad():` instead.
  return (F.adaptive_avg_pool2d(Variable(img,volatile=True), size)).data
Traceback (most recent call last):
  File "detect.py", line 119, in <module>
    detect(cfgfile, weightfile, imgfile)
  File "detect.py", line 77, in detect
    car_boxes = detect_image(img_torch,model)
  File "detect.py", line 45, in detect_image
    output = write_results(output, 0.3, 80, nms = True, nms_conf = 0.25)
  File "/home/kingashar/PyTorch-Onnx-Tensorrt/utils/util.py", line 311, in write_results
    conf_mask = (prediction[:,:,4] > confidence).float().unsqueeze(2)
TypeError: list indices must be integers or slices, not tuple
Rapternmn commented 4 years ago

Hii @AsharFatmi

Can you pull the repo again and check if the issue still persist? I have added a lot more functionalities.

Rapternmn commented 4 years ago

Also please post the command you had executed, on which image you were testing etc.

AsharFatmi commented 4 years ago

I was running the default test image with the given command.

python3 detect.py --cfg cfg/yolov3.cfg --weights weights/yolov3.weights

I will pull and check now. Thanks!!