Encoding matches, integer turns float

asked 2019-03-28 03:46:42 -0600

THordijk gravatar image

updated 2019-03-28 04:20:48 -0600

Hello I am combining the ensenso ros driver with the mask rcnn ros node. I'm using ros kinetic with the master branch of both packages. I am using an RTX 2080 ti and ubuntu 16.04 with kernel 4.15.0-46-generic.

I have altered the code for the mask rcnn node to accept my own trained data and to accept a mono8 image encoding as input, the input image is stacked onto itself to create a fake bgr image. I have tested this against the bagfile that is included as an example and it is still operational. I created my own launch file:

<launch>
  <arg name="configuratie" value="$(find ensenso_camera)/configs/configuratie.json"/>
  <node pkg="ensenso_camera" type="ensenso_camera_node" name="ensenso_camera_node">
    <param name="settings" value="$(arg configuratie)"/>
  </node>
  <node pkg="ensenso_camera" type="request_data" name="image_stream_node">
    <param name="request_rectified_images" value="true"/>
    <param name="publish_results" value="true"/>
  </node>
  <node pkg="tf" type="static_transform_publisher" name="ensenso_optical_frame" 
    args="0 0 0 0 0 0 world ensenso_optical_frame 100"/>
  <node pkg="mask_rcnn_ros" type="mask_rcnn_node" name="mask_rcnn">
    <remap from="~input" to="/rectified/left/image"/>
    <param name="~visualization" value="true"/>
  </node>
</launch>

However, when I launch my launch file, where the both the camera and the model node are started and have their out and input mapped to each other, the model gives the following error:

Traceback (most recent call last):
  File "/home/riwo-rack-pc/ROS_Mask_rcnn/src/mask_rcnn_ros/nodes/mask_rcnn_node", line 182, in <module>
    main()
  File "/home/riwo-rack-pc/ROS_Mask_rcnn/src/mask_rcnn_ros/nodes/mask_rcnn_node", line 179, in main
    node.run()
  File "/home/riwo-rack-pc/ROS_Mask_rcnn/src/mask_rcnn_ros/nodes/mask_rcnn_node", line 104, in run
    results = self._model.detect([np_image], verbose=0)
  File "/home/riwo-rack-pc/ROS_Mask_rcnn/src/mask_rcnn_ros/src/mask_rcnn_ros/model.py", line 2333, in detect
    molded_images, image_metas, windows = self.mold_inputs(images)
  File "/home/riwo-rack-pc/ROS_Mask_rcnn/src/mask_rcnn_ros/src/mask_rcnn_ros/model.py", line 2236, in mold_inputs
    padding=self.config.IMAGE_PADDING)
  File "/home/riwo-rack-pc/ROS_Mask_rcnn/src/mask_rcnn_ros/src/mask_rcnn_ros/utils.py", line 402, in resize_image
    image, (round(h * scale), round(w * scale)))
  File "/home/riwo-rack-pc/.local/lib/python2.7/site-packages/scipy/misc/pilutil.py", line 490, in imresize
    imnew = im.resize(size, resample=func[interp])
  File "/home/riwo-rack-pc/.local/lib/python2.7/site-packages/PIL/Image.py", line 1806, in resize
    return self._new(self.im.resize(size, resample, box))
TypeError: integer argument expected, got float
[mask_rcnn-5] process has died [pid 2784, exit code 1, cmd /home/riwo-rack-pc/ROS_Mask_rcnn/src/mask_rcnn_ros/nodes/mask_rcnn_node ~input:=/rectified/left/image __name:=mask_rcnn __log:=/home/riwo-rack-pc/.ros/log/22188f46-5131-11e9-b28a-049226d3501e/mask_rcnn-5.log].
log file: /home/riwo-rack-pc/.ros/log/22188f46-5131-11e9-b28a-049226d3501e/mask_rcnn-5*.log

Mask_rcnn-5.log states:

rospy.client][INFO] 2019-03-28 09:11:50,034: init_node, name[/mask_r$
[xmlrpc][INFO] 2019-03-28 09:11:50,035: XML-RPC server binding to 0.0$
[xmlrpc][INFO] 2019-03-28 09:11:50,035: Started XML-RPC server [http:$
[rospy.init][INFO] 2019-03-28 09:11:50,035: ROS Slave URI: [http://ri$
[rospy.impl.masterslave][INFO] 2019-03-28 09:11:50,035: _ready: http:$
[rospy.registration][INFO] 2019-03-28 09:11:50,036: Registering with $
[xmlrpc][INFO] 2019-03-28 09:11:50,036 ...
(more)
edit retag flag offensive close merge delete

Comments

1

I have altered the code for the mask rcnn node to accept my own trained data and to accept a mono8 image encoding as input, the input image is stacked onto itself to create a fake bgr image.

that would be the first thing to check. The code was not written for mono images, you changed it.

gvdhoorn gravatar image gvdhoorn  ( 2019-03-28 05:17:37 -0600 )edit