eric-wieser / ros_numpy

Tools for converting ROS messages to and from numpy arrays
MIT License
305 stars 159 forks source link

ValueError: strides is not compatible with available memory #10

Open JackDeSomeTrades opened 5 years ago

JackDeSomeTrades commented 5 years ago

I am trying to subscribe to a msgfy-ied image and that is leading to a value error.

On the publisher side,

 imgpub = rospy.Publisher("/env_level/labelled_image", Image, queue_size=10)
 imgpub.publish(label_image)
def get_label_image():
        im = pilimg.open("label.png")  # Image from PIL
        label = np.asarray(im)
        print (np.shape(label))
        message = msgify(Image, label, encoding="mono8")
        message.height = np.shape(label)[1]
        message.width = np.shape(label)[0]
        return message

On the subscriber callback,

  def lblimg_callback(self, lblimg_data):
        self.label_image = lblimg_data
        im = numpify(self.label_image)

Which leads to the error.

For information, np.intp is int64

eric-wieser commented 5 years ago

Can you show the full error?