File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
lib/src/otx/backend/native Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 4141from otx .types .export import OTXExportFormatType
4242from otx .types .precision import OTXPrecisionType
4343from otx .types .task import OTXTaskType
44- from otx .utils .device import is_xpu_available
44+ from otx .utils .device import get_available_device , is_xpu_available
4545from otx .utils .utils import measure_flops
4646
4747if TYPE_CHECKING :
@@ -909,6 +909,8 @@ def configure_accelerator(self) -> None:
909909 ],
910910 )
911911 self ._cache .args ["precision" ] = None
912+ elif (self ._device .accelerator == DeviceType .cpu ) or (get_available_device () == "cpu" ):
913+ self ._cache .args ["precision" ] = "32"
912914
913915 def configure_loggers (self , logger : Logger | Iterable [Logger ] | bool | None = None ) -> Logger | Iterable [Logger ]:
914916 """Sets up the loggers for the trainer.
You can’t perform that action at this time.
0 commit comments