Skip to content

set_determinism can't work when disable_global_flags #3546

Closed
@Nic-Ma

Description

@Nic-Ma

Is your feature request related to a problem? Please describe.
Issue reported from the internal team, set_determinism raises error when disable_global_flags:

set_determinism(seed=seed)
  File "/workspace/data/medical/MONAI/monai/utils/misc.py", line 255, in set_determinism
    torch.backends.cudnn.deterministic = True
  File "/opt/conda/lib/python3.8/site-packages/torch/backends/__init__.py", line 38, in __set__
    raise RuntimeError("not allowed to set %s flags "
RuntimeError: not allowed to set torch.backends.cudnn flags after disable_global_flags; please use flags() context manager instead

Would be nice to enhance the utility for the global status

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions