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

'_OptionalInputPlaceHolder' object has no attribute 'inbound_nodes' #91

Open
weilaweila opened this issue Jan 18, 2018 · 13 comments
Open

Comments

@weilaweila
Copy link

model = Seq2Seq(batch_input_shape=(16, 7, 5), hidden_dim=10, output_length=8, output_dim=20, depth=4, peek=True)
AttributeError: '_OptionalInputPlaceHolder' object has no attribute 'inbound_nodes'

@natank1
Copy link

natank1 commented Jan 19, 2018

Suffered from the same problem

@harvcode
Copy link

I get this error even for the Simple RNN demo.

@tinglo
Copy link

tinglo commented Jan 20, 2018

I got the same problem.

@harvcode
Copy link

Confirmed same issue with both Theano and Tensorflow backends.

@harvcode
Copy link

harvcode commented Jan 21, 2018

When used together with Keras 2.1.0 the issue doesn't occur.

@tskoba
Copy link

tskoba commented Jan 25, 2018

I found cleverhans-lab/cleverhans#341 may help.

@macgaf
Copy link

macgaf commented Feb 2, 2018

Pls modify code at line 841~851 in engine.py
inbound_nodes -> _inbound_nodes
Just as below:

    if num == 1:
        optional_input_placeholder = _to_list(_OptionalInputPlaceHolder()._inbound_nodes[0].output_tensors)[0]
        assert self._is_optional_input_placeholder(optional_input_placeholder)
        return optional_input_placeholder
    else:
        y = []
        for _ in range(num):
            optional_input_placeholder = _to_list(_OptionalInputPlaceHolder()._inbound_nodes[0].output_tensors)[0]
            assert self._is_optional_input_placeholder(optional_input_placeholder)
            y.append(optional_input_placeholder)
        return y

@natank1
Copy link

natank1 commented Feb 2, 2018 via email

@ETMayberry
Copy link

duplicated by #90

@paul-cb
Copy link

paul-cb commented Mar 2, 2018

I made this change but it still doesn't work.

@yasuyukiokubo
Copy link

Have you changed correct engine.py?

mhr added a commit to mhr/recurrentshop that referenced this issue Apr 22, 2018
kklemon added a commit to kklemon/recurrentshop that referenced this issue May 31, 2018
@deepakkumar1984
Copy link

I still get the issue with the modified code:

@cdhx
Copy link

cdhx commented Apr 5, 2019

there are two engine.py,one is in build/lib, the other is in recurentshop,is this two py the same?
why my engine 841-851 line are like this ,should i change code as you said?
`def get_cell(self, **kwargs):
return RNNCellFromModel(self.model, **kwargs)

def _get_optional_input_placeholder(self, name=None, num=1):
    if name:
        if name not in self._optional_input_placeholders:
            if num > 1:
                self._optional_input_placeholders[name] = [self._get_optional_input_placeholder() for _ in range(num)]
            else:
                self._optional_input_placeholders[name] = self._get_optional_input_placeholder()
        return self._optional_input_placeholders[name]`

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