openkinome / experiments-binding-affinity

6 stars 9 forks source link

Training tests do not work #13

Closed schallerdavid closed 3 years ago

schallerdavid commented 3 years ago

Both training tests in tests/test_examples.sh do not work with the current kinoml master.

They both report the same error:

papermill.exceptions.PapermillExecutionError:
---------------------------------------------------------------------------
Exception encountered at "In [10]":
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-10-c525cb273784> in <module>
      6     a_dataloader = dataloaders[next(iter(dataloaders.keys()))]["train"]
      7     x_sample, _ = next(iter(a_dataloader))
----> 8     MODEL_KWARGS["input_shape"] = ModelCls.estimate_input_shape(x_sample)
      9
     10 nn_model = ModelCls(**MODEL_KWARGS)

~/miniconda3/envs/experiments-binding-affinity/lib/python3.9/site-packages/kinoml/ml/torch_models.py in estimate_input_shape(input_sample)
     23         than a Tensor, please adapt this method accordingly.
     24         """
---> 25         return input_sample.shape[1]
     26
     27
jaimergp commented 3 years ago

If the model is taking in objects different than an array object, the ModelCls.estimate_input_shape needs to be overridden in the subclass to account for whatever object is being passed (tuple of tuples?).