File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010import gc
1111import numpy as np
1212import pandas as pd
13+ from packaging import version
1314from typing import Callable , Optional , Text , Union
1415from sklearn .metrics import roc_auc_score , mean_squared_error
1516
@@ -148,7 +149,7 @@ def __init__(
148149 if scheduler == "default" :
149150 # In torch version 2.7.0, the verbose parameter has been removed. Reference Link:
150151 # https://github.com/pytorch/pytorch/pull/147301/files#diff-036a7470d5307f13c9a6a51c3a65dd014f00ca02f476c545488cd856bea9bcf2L1313
151- if str (torch .__version__ ).split ("+" , maxsplit = 1 )[0 ] <= "2.6.0" :
152+ if version . parse ( str (torch .__version__ ).split ("+" , maxsplit = 1 )[0 ]) <= version . parse ( "2.6.0" ) :
152153 # Reduce learning rate when loss has stopped decrease
153154 self .scheduler = torch .optim .lr_scheduler .ReduceLROnPlateau ( # pylint: disable=E1123
154155 self .train_optimizer ,
You can’t perform that action at this time.
0 commit comments