ur-whitelab / hoomd-tf

A plugin that allows the use of Tensorflow in Hoomd-Blue for GPU-accelerated ML+MD
https://hoomd-tf.readthedocs.io
MIT License
30 stars 8 forks source link

Added TF2.4 to test matrix #256

Closed hgandhi2411 closed 3 years ago

hgandhi2411 commented 3 years ago

Currently, these tests are failing:

FAILED htf/test-py/test_tensorflow.py::test_compute::test_force_output
FAILED htf/test-py/test_tensorflow.py::test_compute::test_model_load
FAILED htf/test-py/test_tensorflow.py::test_compute::test_model_save
FAILED htf/test-py/test_tensorflow.py::test_compute::test_trainable
FAILED htf/test-py/test_tensorflow.py::test_compute::test_training_flag
pep8speaks commented 3 years ago

Hello @hgandhi2411! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 2:41: W291 trailing whitespace Line 3:1: E402 module level import not at top of file Line 4:1: E402 module level import not at top of file Line 5:1: E402 module level import not at top of file Line 5:12: E401 multiple imports on one line Line 6:1: E402 module level import not at top of file Line 7:1: E402 module level import not at top of file Line 8:1: E402 module level import not at top of file Line 10:1: E302 expected 2 blank lines, found 1 Line 21:33: E128 continuation line under-indented for visual indent Line 24:33: E128 continuation line under-indented for visual indent Line 27:1: W293 blank line contains whitespace Line 29:1: W293 blank line contains whitespace Line 31:52: E231 missing whitespace after ',' Line 36:66: E251 unexpected spaces around keyword / parameter equals Line 36:68: E251 unexpected spaces around keyword / parameter equals Line 38:41: E231 missing whitespace after ',' Line 38:59: E202 whitespace before ')' Line 45:13: E306 expected 1 blank line before a nested definition, found 0 Line 52:44: E231 missing whitespace after ',' Line 54:1: W391 blank line at end of file

Comment last updated at 2020-12-23 20:59:53 UTC
whitead commented 3 years ago

Any ideas on failure reasons @hgandhi2411 ?

hgandhi2411 commented 3 years ago

Yes, all test failures are coming from the model.train_on_batch call in tensorflowcompute.py. Error trace:

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/share/miniconda/lib/python3.7/site-packages/hoomd/__init__.py:201: in run
    context.current.system.run(int(tsteps), callback_period, callback, limit_hours, int(limit_multiple));
/usr/share/miniconda/lib/python3.7/site-packages/hoomd/htf/tensorflowcompute.py:283: in _finish_update
    reset_metrics=False)
/usr/share/miniconda/lib/python3.7/site-packages/tensorflow/python/keras/engine/training.py:1725: in train_on_batch
    class_weight)
/usr/share/miniconda/lib/python3.7/site-packages/tensorflow/python/keras/engine/data_adapter.py:1513: in single_batch_iterator
    _check_data_cardinality(data)
/usr/share/miniconda/lib/python3.7/site-packages/tensorflow/python/keras/engine/data_adapter.py:1522: in _check_data_cardinality
    num_samples = set(int(i.shape[0]) for i in nest.flatten(data))
/usr/share/miniconda/lib/python3.7/site-packages/tensorflow/python/keras/engine/data_adapter.py:1522: in <genexpr>
    num_samples = set(int(i.shape[0]) for i in nest.flatten(data))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = TensorShape([]), key = 0

    def __getitem__(self, key):
      """Returns the value of a dimension or a shape, depending on the key.

      Args:
        key: If `key` is an integer, returns the dimension at that index;
          otherwise if `key` is a slice, returns a TensorShape whose dimensions
          are those selected by the slice from `self`.

      Returns:
        An integer if `key` is an integer, or a `TensorShape` if `key` is a
        slice.

      Raises:
        ValueError: If `key` is a slice and `self` is completely unknown and
          the step is set.
      """
      if self._dims is not None:
        if isinstance(key, slice):
          return TensorShape(self._dims[key])
        else:
          if self._v2_behavior:
>           return self._dims[key].value
E           IndexError: list index out of range

/usr/share/miniconda/lib/python3.7/site-packages/tensorflow/python/framework/tensor_shape.py:889: IndexError

TF2.4 has many breaking changes, checking to see where this might be coming from.

whitead commented 3 years ago

Superseded by #285