I have a custom holoscan operator that is very similar to the one implemented in the cupy_example.py in the holohub tutorials. It has an output defined in the setup method by spec.output(‘out’). In my config.yaml file I have a parameter for this component with output_tensor_names: [‘out’]. I want to visualize this output tensor (an RGB image) using HolovizOp. I modified an example such that left_spec = holoscan.operators.HolovizOp.InputSpec(“out”, holoscan.operators.HolovizOp.InputType.COLOR). This left_spec is add to the views of a InputSpec.View() instance. Lastly the custom op is connected to the workflow with self.add_flow(custom_op, visualizer, {(“out”, “receivers”)}). When I try to run the application, which is derived from linux_single_network_stereo_vb1940_player.py in holoscan-sensor-bridge/examples, I get an error: “Exception occurred for operator: ‘holoviz’ = Failed to retrieve input ‘out’. I have tried everything I can think of to make it work with no luck. Any input is desperately welcome.
hello alsulli ,
it’s add_flow to connect the operators together,
please see-also Application structure for the imx274_player example,
please also note that, since HolovizOp it displays the RGBA image on the GUI, in this example, it need to use BayerDemosaicOp to converts the bayer image data into RGBA.
Hi Jerry,
Thanks for the quick reply. As I mentioned, I started from the linux_single_network_stereo_vb1940_player.py example which includes CsiToBayerOp → LinuxReceiverOperator →ImageProcessorOp→BayerDemosaicOp→HolovizOp. My goal is to insert an UndistortOp between BayerDemosaicOp and HolovizOp.
- The UndistortOp implementation has an output named ‘out’ in its spec.
- The instance of UndistortOp in my application has an parameter out_tensor_name=‘out’
- the workflow has a self.add_flow(left_undistort_op, visualizer, {(“out”, “receivers”)})
- I create a InputSpec instance and pass it the tensor name ‘out’ in its constructor.
So as far as I can tell, I have hooked up the plumbing correctly. But I still get an error: “Exception occurred for operator: ‘holoviz’ = Failed to retrieve input ‘out’.
Hi Jerry:
I figured out my problem and thought I would update you and everyone else who might run into this issue. The solution was simple. I was returning a raw cupy.Tensor from my CUDA kernel, but this is not correct. Instead, one needs to return a dict that in my case was {‘out’: out_tensor}. To be more specific, the compute method of my operator does “op_output({‘out’: out_tensor}, ‘out’)”. With that, the application works and display the correct results.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.