question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: 'Dense' object has no attribute 'outbound_nodes'

See original GitHub issue

Describe the Bug

when run “outputs = keras.layers.Dense(units=2, activation=‘softmax’)(dense)” got error : AttributeError: ‘Dense’ object has no attribute ‘outbound_nodes’

Version Info

  • I’m using the latest version

Minimal Codes To Reproduce

import keras_bert

inputs = model.inputs[:2]
dense = model.get_layer('NSP-Dense').output
outputs = keras.layers.Dense(units=2, activation='softmax')(dense)

pass

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
CyberZHGcommented, Aug 21, 2019

Possible cause:

  • You’re using tensorflow==1.13.2
  • from tensorflow.python import keras
  • TF_KERAS=1 is not set properly
0reactions
CyberZHGcommented, Aug 22, 2019

@Dimesio

That is because one can only use tf.keras on TPU. Just use import keras and ignore TF_KERAS if you don’t know much about tf.keras.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Keras + Tensorflow: 'ConvLSTM2D' object has no attribute ...
This fixed AttributeError: 'ConvLSTM2D' object has no attribute 'outbound_nodes'” and then I just used layers.flatten(lstm_layer) and ...
Read more >
Keras error: 'Conv2D' object has no attribute 'outbound_nodes'
Hi, I'm trying to run my kernel code where I use layers from a Model and get this error message. 'Conv2D' object has...
Read more >
[tensorflow/keras] 'Embedding' object has no attribute ...
[tensorflow/keras] 'Embedding' object has no attribute 'outbound_nodes' solution. I encountered an error while I followed the tutorial about calculating ...
Read more >
AttributeError: 'Dense' object has no attribute 'op' - CSDN博客
AttributeError : 'Dense' object has no attribute 'op'SolutionSolution在看keras官方文档application 的finetune模块时1的时候想尝试以下代码块from ...
Read more >
Conv2D' object has no attribute 'is_placeholder'
core import Dense, Activation, Lambda, Reshape,Flatten. from keras.layers import Conv2D, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found