Skip to content

Missing builtin op torchvision::nms in Windows #7

@b21quocbao

Description

@b21quocbao

Here is the full log

const scriptModule = new torch.ScriptModule(`models/retinaface-torch/scripted_model_${haveGpu ? 'gpu' : 'cpu'}_19042021.pt`);
                     ^

Error:
Unknown builtin op: torchvision::nms.
Could not find any similar ops to torchvision::nms. This op may not exist or may not be currently supported in TorchScript.
:
  File "/home/geneous/anaconda3/envs/main/lib/python3.7/site-packages/torchvision/ops/boxes.py", line 36
    """
    _assert_has_ops()
    return torch.ops.torchvision.nms(boxes, scores, iou_threshold)
           ~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
Serialized   File "code/__torch__/torchvision/ops/boxes.py", line 26
  _8 = __torch__.torchvision.extension._assert_has_ops
  _9 = _8()
  _10 = ops.torchvision.nms(boxes, scores, iou_threshold)
        ~~~~~~~~~~~~~~~~~~~ <--- HERE
  return _10
'nms' is being compiled since it was called from 'batched_nms'
  File "/home/geneous/anaconda3/envs/main/lib/python3.7/site-packages/torchvision/ops/boxes.py", line 75
        offsets = idxs.to(boxes) * (max_coordinate + torch.tensor(1).to(boxes))
        boxes_for_nms = boxes + offsets[:, None]
        keep = nms(boxes_for_nms, scores, iou_threshold)
               ~~~ <--- HERE
        return keep
Serialized   File "code/__torch__/torchvision/ops/boxes.py", line 18
    _7 = torch.slice(offsets, 0, 0, 9223372036854775807, 1)
    boxes_for_nms = torch.add(boxes, torch.unsqueeze(_7, 1), alpha=1)
    keep = __torch__.torchvision.ops.boxes.nms(boxes_for_nms, scores, iou_threshold, )
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
    _0 = keep
  return _0
'batched_nms' is being compiled since it was called from 'RetinaNetDetector.postprocess_batch'
Serialized   File "code/__torch__/model.py", line 139
    landms: Tensor) -> List[Tuple[List[Tensor], List[Tensor]]]:
    _41 = __torch__.net.apply_indices_2d_to_3d
    _42 = __torch__.torchvision.ops.boxes.batched_nms
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
    batch_size, channels, im_height, im_width, = torch.size(batched_tensor)
    image_size_str = torch.format("{}x{}", im_height, im_width)
'RetinaNetDetector.postprocess_batch' is being compiled since it was called from 'RetinaNetDetector.forward_batch'
  File "/media/geneous/e3359753-18af-45fb-b3d4-c5a0ced00e0c/Techainer/face/retinaface_torchscript/model.py", line 461
        # Postprocessing
        # st = time.time()
        output = self.postprocess_batch(batched_tensor, all_scale, loc, conf, landms)
                 ~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
        # torch.cuda.synchronize()
        # print("Postprocess tooks:", (time.time()-st)*1000, "ms")
Serialized   File "code/__torch__/model.py", line 43
    _2 = (self.model).forward(batched_tensor, )
    loc, conf, landms, = _2
    output = (self).postprocess_batch(batched_tensor, all_scale, loc, conf, landms, )
                                                                            ~~~~~~ <--- HERE
    return output
  def postprocess(self: __torch__.model.RetinaNetDetector,

    at Object.<anonymous> (C:\Users\ngoba\work\backend-monolith\test.js:3:22)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions