havakv / pycox

Survival analysis with PyTorch
BSD 2-Clause "Simplified" License
780 stars 180 forks source link

AttributeError: 'DeepHitSingle' object has no attribute 'state_dict' #167

Open zachfreitas opened 1 year ago

zachfreitas commented 1 year ago

I'm trying to save my model using tensor flow save and I get the following Error when I use state_dict. mdl.state_dict() I get the follwing AttributeError: 'DeepHitSingle' object has no attribute 'state_dict'

Is there a way around this?

mahootiha-maryam commented 11 months ago

Firstly pycox is based on pytorch, not tensorflow. Also for saving models you can not use state_dict you can save models in pycox in this way.

model.save_model_weights('myweights.pt') model.load_model_weights('myweights.pt')

Also there was a previous issue on this question that havard explained it.