nobuco
nobuco copied to clipboard
Unimplemented Nodes: roi_align
I am trying to convert a pytorch model to TF lite using this module called nobuco, I am facing some serious trouble and would really appreciate some guidance/help. It's a Yolo model and the error stack ends with something that looks like this:
Unimplemented nodes:
FasterRCNN[torchvision.models.detection.faster_rcnn](float32_0<1,3,224,224>) -> [{"boxes": float32_13<5,4>, "labels": int64_11<5>, "scores": float32_12<5>}]
├· RoIHeads[torchvision.models.detection.roi_heads]({"0": float32_1<1,256,10,10>, "1": float32_2<1,256,10,10>, "pool": float32_3<1,256,5,5>}, [float32_4<61,4>], [(320, 320)], None) -> ([{"boxes": float32_10<5,4>, "labels": int64_11<5>, "scores": float32_12<5>}], {})
│ │ MultiScaleRoIAlign[torchvision.ops.poolers]({"0": float32_1<1,256,10,10>, "1": float32_2<1,256,10,10>, "pool": float32_3<1,256,5,5>}, [float32_4<61,4>], [(320, 320)]) -> float32_9<61,256,7,7>
│ │ │ _filter_input[torchvision.ops.poolers]({"0": float32_1<1,256,10,10>, "1": float32_2<1,256,10,10>, "pool": float32_3<1,256,5,5>}, ["0", "1", "2", "3"]) -> [float32_1<1,256,10,10>, float32_2<1,256,10,10>]
│ │ ├· _multiscale_roi_align[torchvision.ops.poolers]([float32_1<1,256,10,10>, float32_2<1,256,10,10>], [float32_4<61,4>], (7, 7), 2, [0.03125, 0.03125], LevelMapper(k_min = 5, k_max = 5, s0 = 224, lvl0 = 4, eps = 1e-06)) -> float32_9<61,256,7,7>
│ │ │ │ roi_align[torchvision.ops.poolers](float32_1<1,256,10,10>, float32_5<61,5>, output_size=(7, 7), spatial_scale=0.03125, sampling_ratio=2) -> float32_6<61,256,7,7>
│ │ │ │ └· roi_align[torch._ops.torchvision](float32_1<1,256,10,10>, float32_5<61,5>, 0.03125, 7, 7, 2, False) -> float32_6<61,256,7,7>
│ │ │ │ roi_align[torchvision.ops.poolers](float32_2<1,256,10,10>, float32_7<0,5>, output_size=(7, 7), spatial_scale=0.03125, sampling_ratio=2) -> float32_8<0,256,7,7>
└ └ └ └ └· roi_align[torch._ops.torchvision](float32_2<1,256,10,10>, float32_7<0,5>, 0.03125, 7, 7, 2, False) -> float32_8<0,256,7,7>
----------------------------------------------------------------------
```-----
Exception Traceback (most recent call last)
<ipython-input-11-8d29e12735cb> in <cell line: 1>()
----> 1 keras_model = nobuco.pytorch_to_keras(
2 model,
3 args=[dummy_image], kwargs=None,
4 inputs_channel_order=ChannelOrder.TENSORFLOW,
5 outputs_channel_order=ChannelOrder.TENSORFLOW,
/usr/local/lib/python3.10/dist-packages/nobuco/convert.py in pytorch_to_keras(model, args, kwargs, input_shapes, inputs_channel_order, outputs_channel_order, input_names, output_names, trace_shape, enable_torch_tracing, constants_to_variables, full_validation, validation_tolerance, return_outputs_pt, save_trace_html, debug_traces)
349 print('Unimplemented nodes:')
350 print(unimplemented_hierarchy.__str__(**vis_params))
--> 351 raise Exception('Unimplemented nodes')
352
353 keras_op = keras_converted_node.keras_op
Exception: Unimplemented nodes
I have looked through the documentation and am unable to use the info in it to solve the error. Appreciate the help.
Thanks in advance.