ms2deepscore icon indicating copy to clipboard operation
ms2deepscore copied to clipboard

multi_inputs is not automatically detected

Open niekdejonge opened this issue 3 years ago • 2 comments

I am running the new multi_inputs pipeline, when running MS2Deepscore, you require to add multi_inputs=True.

The error you get when forgetting to set this to True is confusing: /ms2deepscore/MS2DeepScore.py", line 76, in _create_input_vector X = np.zeros((1, self.input_vector_dim)) TypeError: 'tuple' object cannot be interpreted as an integer

Two possible solutions:

  1. Add an assert statement in MS2Deepscore init, that checks if the input layer is not a tuple. And raises an error suggesting to use multi_inputs =True.
  2. Automatically detect if a model is multi_input. Maybe by storing that it is multi_input as part of the model. Or by detecting the shape of the base model and automatically setting it to multi_input, if the shape is a tuple.

@florian-huber @djoas Thanks for implementing this :) Let me know if the issue I try to address is unclear!

niekdejonge avatar Dec 05 '22 10:12 niekdejonge

Sounds like good suggestions!

  1. Would be more comfortable to use, but is probably not backward compatible.
  2. Seems easy to implement.

florian-huber avatar Dec 05 '22 13:12 florian-huber

Thanks for the suggestion! I updated the branch additional_input_parameters with a solution to automatically detect if there are multiple inputs and removed the keyword multi_inputs.

djoas avatar Dec 05 '22 15:12 djoas