提交 04dc29e4 编写于 作者: M Megvii Engine Team

fix(imperative/data): fix dataloader memory check warning

GitOrigin-RevId: e0f62f83b86b47ba7bdef9ac102e777a4fc3faa2
上级 d6295b06
......@@ -178,12 +178,9 @@ class DataLoader:
main_memory = psutil.Process(os.getpid()).memory_info().rss / 1024 / 1024 / 1024
total_memory = (self.num_workers + 1) * main_memory
current_memory = (
int(os.popen("cat /sys/fs/cgroup/memory/memory.limit_in_bytes").read())
/ 1024
/ 1024
/ 1024
)
limit_in_bytes = os.popen("cat /sys/fs/cgroup/memory/memory.limit_in_bytes")
current_memory = int(limit_in_bytes.read()) / 1024 / 1024 / 1024
limit_in_bytes.close()
if current_memory < total_memory:
logger.warning(
"Each worker need to read the shared meta-data, which will be increasing the reference count."
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册