From 94ed608ca046e71507603a65731347b1b245c5f1 Mon Sep 17 00:00:00 2001 From: Austin Welch Date: Thu, 24 Nov 2022 23:01:38 -0500 Subject: [PATCH] [Fix] switch mmaction2totorchserve from mmcv to mmengine (#2053) * switch to mmengine * fix precommit --- tools/deployment/mmaction2torchserve.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/deployment/mmaction2torchserve.py b/tools/deployment/mmaction2torchserve.py index d491ac7b36..bb170c8c88 100644 --- a/tools/deployment/mmaction2torchserve.py +++ b/tools/deployment/mmaction2torchserve.py @@ -4,7 +4,8 @@ from pathlib import Path from tempfile import TemporaryDirectory -import mmcv +from mmengine.config import Config +from mmengine.utils import mkdir_or_exist try: from model_archiver.model_packaging import package_model @@ -38,9 +39,9 @@ def mmaction2torchserve( force (bool): If True, if there is an existing `{model_name}.mar` file under `output_folder` it will be overwritten. """ - mmcv.mkdir_or_exist(output_folder) + mkdir_or_exist(output_folder) - config = mmcv.Config.fromfile(config_file) + config = Config.fromfile(config_file) with TemporaryDirectory() as tmpdir: config.dump(f'{tmpdir}/config.py')