Fix Ray 2.7.0 breaking changes (#4964)
This commit is contained in:
parent
742ec7fb1d
commit
0cf82f5040
5 changed files with 15 additions and 13 deletions
|
|
@ -392,17 +392,17 @@ class Model(nn.Module):
|
|||
"""Clear all event callbacks."""
|
||||
self.callbacks[event] = []
|
||||
|
||||
def reset_callbacks(self):
|
||||
"""Reset all registered callbacks."""
|
||||
for event in callbacks.default_callbacks.keys():
|
||||
self.callbacks[event] = [callbacks.default_callbacks[event][0]]
|
||||
|
||||
@staticmethod
|
||||
def _reset_ckpt_args(args):
|
||||
"""Reset arguments when loading a PyTorch model."""
|
||||
include = {'imgsz', 'data', 'task', 'single_cls'} # only remember these arguments when loading a PyTorch model
|
||||
return {k: v for k, v in args.items() if k in include}
|
||||
|
||||
def _reset_callbacks(self):
|
||||
"""Reset all registered callbacks."""
|
||||
for event in callbacks.default_callbacks.keys():
|
||||
self.callbacks[event] = [callbacks.default_callbacks[event][0]]
|
||||
|
||||
# def __getattr__(self, attr):
|
||||
# """Raises error if object has no requested attribute."""
|
||||
# name = self.__class__.__name__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue