cangermueller / deepcpg

Deep neural networks for predicting CpG methylation
MIT License
143 stars 66 forks source link

AttributeError: 'list' object has no attribute 'get_shape' when building model #15

Closed ajsteele closed 6 years ago

ajsteele commented 6 years ago

I am trying to use dcpg_train.py, but it fails at the model-building stage like this:

INFO (2017-11-17 11:41:39,196): Building DNA model ...
Traceback (most recent call last):
  File "anaconda/envs/tensorflow/bin/dcpg_train.py", line 828, in <module>
    app.run(sys.argv)
  File "anaconda/envs/tensorflow/bin/dcpg_train.py", line 192, in run
    return self.main(name, opts)
  File "anaconda/envs/tensorflow/bin/dcpg_train.py", line 699, in main
    model = self.build_model()
  File "anaconda/envs/tensorflow/bin/dcpg_train.py", line 591, in build_model
    outputs = mod.add_output_layers(stem.outputs, output_names)
  File "/home/MYUSERNAME/anaconda/envs/deepcpg/lib/python3.6/site-packages/deepcpg-1.0.4-py3.6.egg/deepcpg/models/utils.py", line 260, in add_output_layers
  File "/home/MYUSERNAME/anaconda/envs/deepcpg/lib/python3.6/site-packages/keras/engine/topology.py", line 554, in __call__
    output = self.call(inputs, **kwargs)
  File "/home/MYUSERNAME/anaconda/envs/deepcpg/lib/python3.6/site-packages/keras/layers/core.py", line 840, in call
    output = K.dot(inputs, self.kernel)
  File "/home/MYUSERNAME/anaconda/envs/deepcpg/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 822, in dot
    if ndim(x) is not None and (ndim(x) > 2 or ndim(y) > 2):
  File "/home/MYUSERNAME/anaconda/envs/deepcpg/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 437, in ndim
    dims = x.get_shape()._dims
AttributeError: 'list' object has no attribute 'get_shape'

I am using the latest commit to the master branch here, keras 2.0.2 (and have tried more recent versions) and tensorflow-gpu 1.4.0.

Thanks in advance for any suggestions!

ajsteele commented 6 years ago

I reran this today having changed nothing obvious and yet it seems now to work. Apologies!