From 5fb2e8e158d3d6176b97e13d8d5ae6fed7ab91a0 Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Tue, 20 Jun 2023 17:08:39 +0800 Subject: [PATCH] fix(data): fix pyarrow.plasma import error in pyarrow1.12 GitOrigin-RevId: b5e1cd3be59cc80a3cc5bf6a83855ede2a2cd38a --- imperative/python/megengine/data/dataloader.py | 1 - imperative/python/megengine/data/tools/_queue.py | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/imperative/python/megengine/data/dataloader.py b/imperative/python/megengine/data/dataloader.py index 6cbe88dc0..e8635f2b0 100644 --- a/imperative/python/megengine/data/dataloader.py +++ b/imperative/python/megengine/data/dataloader.py @@ -27,7 +27,6 @@ try: except: import _thread as thread - logger = get_logger(__name__) diff --git a/imperative/python/megengine/data/tools/_queue.py b/imperative/python/megengine/data/tools/_queue.py index bc3ad98bd..62176acd3 100644 --- a/imperative/python/megengine/data/tools/_queue.py +++ b/imperative/python/megengine/data/tools/_queue.py @@ -9,6 +9,13 @@ import pyarrow MGE_PLASMA_MEMORY = int(os.environ.get("MGE_PLASMA_MEMORY", 4000000000)) # 4GB +try: + import pyarrow.plasma as plasma +except ModuleNotFoundError: + raise RuntimeError( + "pyarrow remove plasma in version 12.0.0, please use pyarrow vserion < 12.0.0" + ) + try: import pyarrow.plasma as plasma except ModuleNotFoundError: -- GitLab