Fix import exceptions in tracing.py for older (<1.12) versions of pytorch
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/362 X-link: https://github.com/facebookresearch/detectron2/pull/4491 Recently landed D35518556 (https://github.com/facebookresearch/d2go/commit/1ffc801bf5a1d4fe926b815ba93f21632f0980f9) / Github: 36a65a0907d90ed591479b2ebaa8b61cfa0b4ef0 throws an exception with older versions of PyTorch, due to a missing library for import. This has been reported by multiple members of the PyTorch community at https://github.com/facebookresearch/detectron2/commit/36a65a0907d90ed591479b2ebaa8b61cfa0b4ef0 This change uses `try/except` to check for libraries and set flags on presence/absence to later guard code that would use them. Reviewed By: wat3rBro Differential Revision: D38879134 fbshipit-source-id: 72f5a7a8d350eb82be87567f006368bf207f5a74
Showing
Please register or sign in to comment