Skip to content
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

Getting SceneOptimizer to run on macos #71

Merged
merged 10 commits into from
Jan 12, 2021

Conversation

johnwlambert
Copy link
Collaborator

CUDA not properly supported on OSX, but CUDA is desired when available on linux to accelerate deep front-ends.

@ayushbaid ayushbaid changed the title Rename environment.yml to environment_linux.yml Getting scene_optimizer to run on macos Jan 8, 2021
@ayushbaid ayushbaid changed the title Getting scene_optimizer to run on macos Getting SceneOptimizer to run on macos Jan 8, 2021
@johnwlambert
Copy link
Collaborator Author

@ayushbaid I tried out this env on my mac today. Still not functional:

(gtsfm-v2) dept-143-215-34-104:gtsfm johnlambert$ python gtsfm/scene_optimizer.py 
Traceback (most recent call last):
  File "gtsfm/scene_optimizer.py", line 19, in <module>
    from gtsam import Cal3Bundler, PinholeCameraCal3Bundler, Pose3, Rot3, Unit3
  File "/Users/johnlambert/opt/miniconda3/envs/gtsfm-v2/lib/python3.8/site-packages/gtsam/__init__.py", line 2, in <module>
    from .gtsam import *
ModuleNotFoundError: No module named 'gtsam.gtsam'

@ayushbaid
Copy link
Contributor

@ayushbaid I tried out this env on my mac today. Still not functional:

(gtsfm-v2) dept-143-215-34-104:gtsfm johnlambert$ python gtsfm/scene_optimizer.py 
Traceback (most recent call last):
  File "gtsfm/scene_optimizer.py", line 19, in <module>
    from gtsam import Cal3Bundler, PinholeCameraCal3Bundler, Pose3, Rot3, Unit3
  File "/Users/johnlambert/opt/miniconda3/envs/gtsfm-v2/lib/python3.8/site-packages/gtsam/__init__.py", line 2, in <module>
    from .gtsam import *
ModuleNotFoundError: No module named 'gtsam.gtsam'

This is weird. Unfortunately, I dont have a macos device to debug this issue. Maybe try uninstalling and reinstalling gtsam via pip?

@johnwlambert
Copy link
Collaborator Author

@ayushbaid I tried out this env on my mac today. Still not functional:

(gtsfm-v2) dept-143-215-34-104:gtsfm johnlambert$ python gtsfm/scene_optimizer.py 
Traceback (most recent call last):
  File "gtsfm/scene_optimizer.py", line 19, in <module>
    from gtsam import Cal3Bundler, PinholeCameraCal3Bundler, Pose3, Rot3, Unit3
  File "/Users/johnlambert/opt/miniconda3/envs/gtsfm-v2/lib/python3.8/site-packages/gtsam/__init__.py", line 2, in <module>
    from .gtsam import *
ModuleNotFoundError: No module named 'gtsam.gtsam'

This is weird. Unfortunately, I dont have a macos device to debug this issue. Maybe try uninstalling and reinstalling gtsam via pip?

Tried that, but unfortunately same issue. Also tried pip install --pre gtsam in the environment, got same issue. @ProfFan any clue what my issue might be?

@ProfFan
Copy link
Contributor

ProfFan commented Jan 9, 2021

I think the problem may be that the macOS build is targeting Python 3.9?

@ProfFan
Copy link
Contributor

ProfFan commented Jan 9, 2021

Just tried pip install with my Homebrew-installed Python 3.9. Got no problem.

@ProfFan
Copy link
Contributor

ProfFan commented Jan 9, 2021

Please be sure that you have no prior install of gtsam, by running pip uninstall gtsam for 3 times.

@johnwlambert
Copy link
Collaborator Author

Just tried pip install with my Homebrew-installed Python 3.9. Got no problem.

Thanks @ProfFan . I was able to get the import to work right away when I changed the version to 3.9 in the conda environment file (we have it as 3.8 there currently).

Dask has a few compatibility issues in 3.9 though on my mac, that i didn't see on python 3.7 or 3.8 though on mac or linux. See my report here: #74

I propose we use python 3.8 for now to avoid those issues.

Also, @ayushbaid @dellaert we won't be able to run python gtsfm/scene_optimizer.py until we have a GTSAM wheel with the serialization PR merged since multiprocessing is our hard-coded dask setting currently, otherwise we'll get AttributeError: 'gtsam.gtsam.SfmData' object has no attribute 'serialize'.

@ayushbaid should we make that a config setting to determine to use threads vs. processes?

@dellaert
Copy link
Member

I'm urgently awaiting this :-) Please email me at GT account when this is ready to try for me by just checking out this branch and following README....

@johnwlambert johnwlambert merged commit f654e20 into master Jan 12, 2021
@johnwlambert johnwlambert deleted the separate-mac-linux-environments branch January 12, 2021 19:36
@dellaert
Copy link
Member

Does that mean it works now!?

@dellaert
Copy link
Member

I have not gotten an email :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants