Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dense layer: 'module' object has no attribute 'unpack' on TensorFlow 1.0.0rc0 #5226

Closed
2 tasks done
luthfianto opened this issue Jan 30, 2017 · 0 comments
Closed
2 tasks done

Comments

@luthfianto
Copy link
Contributor

<ipython-input-3-4256fdfb69f0> in create_model(gate)
    134     net = Convolution1D(num_label, 1, init=init)(net)
    135     #net = Dropout(0.5)(net)
--> 136     net = Dense(num_label, activation='softmax', init=init)(net)
    137     model = Model(input=input_, output=net)
    138     return model

/usr/local/lib/python2.7/dist-packages/keras/engine/topology.pyc in __call__(self, x, mask)
    567         if inbound_layers:
    568             # This will call layer.build() if necessary.
--> 569             self.add_inbound_node(inbound_layers, node_indices, tensor_indices)
    570             # Outputs were already computed when calling self.add_inbound_node.
    571             outputs = self.inbound_nodes[-1].output_tensors

/usr/local/lib/python2.7/dist-packages/keras/engine/topology.pyc in add_inbound_node(self, inbound_layers, node_indices, tensor_indices)
    630         # creating the node automatically updates self.inbound_nodes
    631         # as well as outbound_nodes on inbound layers.
--> 632         Node.create_node(self, inbound_layers, node_indices, tensor_indices)
    633 
    634     def get_output_shape_for(self, input_shape):

/usr/local/lib/python2.7/dist-packages/keras/engine/topology.pyc in create_node(cls, outbound_layer, inbound_layers, node_indices, tensor_indices)
    162 
    163         if len(input_tensors) == 1:
--> 164             output_tensors = to_list(outbound_layer.call(input_tensors[0], mask=input_masks[0]))
    165             output_masks = to_list(outbound_layer.compute_mask(input_tensors[0], input_masks[0]))
    166             # TODO: try to auto-infer shape

/usr/local/lib/python2.7/dist-packages/keras/layers/core.pyc in call(self, x, mask)
    766 
    767     def call(self, x, mask=None):
--> 768         output = K.dot(x, self.W)
    769         if self.bias:
    770             output += self.b

/usr/local/lib/python2.7/dist-packages/keras/backend/tensorflow_backend.pyc in dot(x, y)
    783     if ndim(x) is not None and (ndim(x) > 2 or ndim(y) > 2):
    784         x_shape = []
--> 785         for i, s in zip(int_shape(x), tf.unpack(tf.shape(x))):
    786             if i is not None:
    787                 x_shape.append(i)

AttributeError: 'module' object has no attribute 'unpack'

Code to easily reproduce the issue:

import tensorflow as tf
x=tf.Variable(4.0)
tf.unpack(tf.shape(x))

It seems that it is because tf.unpack has been renamed to tf.unstack


Checklist:

  • Keras master
  • TensorFlow 1.0.0rc0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant