-
Notifications
You must be signed in to change notification settings - Fork 768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
serialization fails for gtsam_unstable factors #1173
Comments
Strange, I tested them all and they work (at least if I build the Python module with CMake locally). |
@ProfFan yes, this issue occurs with the PyPi package. |
I just tested this with the PyPI package and I cannot reproduce it. Can you please try again with the latest python package? You can upgrade by running |
@varunagrawal still getting the same problem with 4.2a7. |
@shteren1 This is very strange. I think you may have a global GTSAM install that is interfering with the PyPI one. I would suggest you first test in a CLEAN Ubuntu VM and report the result. |
@ProfFan i just tried in a clean empty ubuntu 18.04 docker image and i get the same, using this docker file:
and then docker run -it and ran:
then entered python and ran the script in the issue description. |
@varunagrawal you need to update the pip version, the default old pip can't find it: |
Yup I did that, but no dice. |
@varunagrawal here is my log from the docker session if its any help:
|
I was running the docker container on a Mac and was seeing issues, but running on a Linux desktop seems to work fine. Maybe an issue with M1 chip compatibility? @ProfFan |
Yes! I am able to reproduce it. Thanks for the patience @shteren1, will hopefully have a fix for you soon. |
FYI this is also an issue on Ubuntu 20.04. I am using this version since CMake is able to find Python3 more easily here. |
So the error message is coming from Boost, not Python. My guess is that some linking is going wonky but it doesn't show on local builds, only on external builds. |
I wrote up a simple unit test typedef gtsam::ProjectionFactorPPP<gtsam::Pose3, gtsam::Point3, gtsam::Cal3_S2> gtsamProjectionFactorPPPgtsamPose3gtsamPoint3gtsamCal3_S2;
BOOST_CLASS_EXPORT(gtsamProjectionFactorPPPgtsamPose3gtsamPoint3gtsamCal3_S2)
TEST(ProjectionFactorPPP, Serialize) {
Key poseKey(X(1));
Key transformKey(T(1));
Key pointKey(L(1));
Point2 measurement(323.0, 240.0);
gtsamProjectionFactorPPPgtsamPose3gtsamPoint3gtsamCal3_S2 factor(measurement, model, poseKey, transformKey, pointKey, K);
// Serialize the factor
std::string serialized = serialize(factor);
// // And de-serialize it
// TestProjectionFactor deserializedFactor;
// deserializeXML(serialized, deserializedFactor);
} and it throws the same exception so it looks like factor serialization is broken. |
Description
Calling .serialize() on a gtsam_unstable factor in python wrapper fails with the following traceback:
Steps to reproduce
Expected behavior
.serialize() should return a string that can be used to deserialize later
Environment
Latest pip package 4.2a6 on ubuntu 18.04
Additional information
I tested several other factors in gtsam_unstable, they all fail to serialize.
The text was updated successfully, but these errors were encountered: