Skip to content

Commit

Permalink
Merge branch 'dev' into add-py-property-support
Browse files Browse the repository at this point in the history
  • Loading branch information
bhashemian authored Oct 23, 2024
2 parents a0283ed + 90173c9 commit cb6d816
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
3 changes: 1 addition & 2 deletions monai/bundle/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -1945,7 +1945,6 @@ def create_workflow(
"""
_args = update_kwargs(args=args_file, workflow_name=workflow_name, config_file=config_file, **kwargs)
_log_input_summary(tag="run", args=_args)
(workflow_name, config_file) = _pop_args(
_args, workflow_name=ConfigWorkflow, config_file=None
) # the default workflow name is "ConfigWorkflow"
Expand All @@ -1969,7 +1968,7 @@ def create_workflow(
workflow_ = workflow_class(**_args)

workflow_.initialize()

_log_input_summary(tag="run", args=_args)
return workflow_


Expand Down
2 changes: 1 addition & 1 deletion monai/bundle/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ def __init__(
else:
raise FileNotFoundError(f"Cannot find the logging config file: {logging_file}.")
else:
logger.info(f"Setting logging properties based on config: {logging_file}.")
fileConfig(str(logging_file), disable_existing_loggers=False)
logger.info(f"Setting logging properties based on config: {logging_file}.")

self.parser = ConfigParser()
self.parser.read_config(f=config_file)
Expand Down
2 changes: 1 addition & 1 deletion monai/handlers/stats_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def __init__(
output_transform: Callable = lambda x: x[0],
global_epoch_transform: Callable = lambda x: x,
state_attributes: Sequence[str] | None = None,
name: str | None = "StatsHandler",
name: str | None = "monai.handlers.StatsHandler",
tag_name: str = DEFAULT_TAG,
key_var_format: str = DEFAULT_KEY_VAL_FORMAT,
) -> None:
Expand Down
6 changes: 3 additions & 3 deletions monai/networks/trt_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def __init__(self, plan_path, logger=None):
logger: optional logger object
"""
self.plan_path = plan_path
self.logger = logger or get_logger("trt_compile")
self.logger = logger or get_logger("monai.networks.trt_compiler")
self.logger.info(f"Loading TensorRT engine: {self.plan_path}")
self.engine = engine_from_bytes(bytes_from_path(self.plan_path))
self.tensors = OrderedDict()
Expand Down Expand Up @@ -288,7 +288,7 @@ def __init__(
self.fallback = fallback
self.disabled = False

self.logger = logger or get_logger("trt_compile")
self.logger = logger or get_logger("monai.networks.trt_compiler")

# Normally we read input_names from forward() but can be overridden
if input_names is None:
Expand Down Expand Up @@ -563,7 +563,7 @@ def find_sub(parent, submodule):
else:
wrap(model, base_path)
else:
logger = logger or get_logger("trt_compile")
logger = logger or get_logger("monai.networks.trt_compiler")
logger.warning("TensorRT and/or polygraphy packages are not available! trt_compile() has no effect.")

return model
2 changes: 1 addition & 1 deletion monai/utils/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ def run_cmd(cmd_list: list[str], **kwargs: Any) -> subprocess.CompletedProcess:
if kwargs.pop("run_cmd_verbose", False):
import monai

monai.apps.utils.get_logger("run_cmd").info(f"{cmd_list}") # type: ignore[attr-defined]
monai.apps.utils.get_logger("monai.utils.run_cmd").info(f"{cmd_list}") # type: ignore[attr-defined]
try:
return subprocess.run(cmd_list, **kwargs)
except subprocess.CalledProcessError as e:
Expand Down
3 changes: 2 additions & 1 deletion tests/test_trt_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from monai.networks import trt_compile
from monai.networks.nets import UNet, cell_sam_wrapper, vista3d132
from monai.utils import min_version, optional_import
from tests.utils import skip_if_no_cuda, skip_if_quick, skip_if_windows
from tests.utils import SkipIfAtLeastPyTorchVersion, skip_if_no_cuda, skip_if_quick, skip_if_windows

trt, trt_imported = optional_import("tensorrt", "10.1.0", min_version)
polygraphy, polygraphy_imported = optional_import("polygraphy")
Expand All @@ -46,6 +46,7 @@ def tearDown(self):
if current_device != self.gpu_device:
torch.cuda.set_device(self.gpu_device)

@SkipIfAtLeastPyTorchVersion((2, 5, 0))
def test_handler(self):
from ignite.engine import Engine

Expand Down

0 comments on commit cb6d816

Please sign in to comment.