[go: up one dir, main page]

Skip to content

`CClassifierPyTorch.set_state` crashes if `model` is not in the state dictionary

The set_state method can be used to restore the state of a class, even only parts of it (passing not all attributes). However, CClassifierPyTorch.set_state always requires the model attribute to be in the state_dict, which leads to the method crashing for example when the CClassifierPyTorch object is inside other objects, e.g. a normalized.

We should only trying to restore the model if model is inside the state_dict: if 'model' in state_dict:...

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information