twopin / CAMP

predicting peptide-protein interactions
117 stars 30 forks source link

Unknown loss function: conditional_BCE; predict_CAMP.py #36

Open AnthonyYao7 opened 1 year ago

AnthonyYao7 commented 1 year ago

Traceback (most recent call last): File "predict_CAMP.py", line 199, in custom_objects={'Self_Attention': Self_Attention, 'boost_mask_BCE_loss': boost_mask_BCE_loss}) ValueError: Unknown loss function:conditional_BCE

This occurred when running with --m=2. How can this be fixed?

ZJL0111 commented 11 months ago

If you check the CAMP_BS.h5 file ,you will see training_config: b'{"metrics": null, "loss": {"nn_prob_peptide": "conditional_BCE", "predictions": "binary_crossentropy"}, "optimizer_config": {"class_name": "RMSprop", "config": {"epsilon": 1e-08, "lr": 0.0005000000237487257, "rho": 0.8999999761581421, "decay": 9.999999974752427e-07}}, "loss_weights": {"nn_prob_peptide": 10, "predictions": 1.0}, "sample_weight_mode": null}'

so chage the 'boost_mask_BCE_loss' to 'conditional_BCE' can solve this issue.

but i still get other errors when load CAMP_BS.h5, which is AttributeError: 'function' object has no attribute 'get_shape'