Comments (4)
@MengXiangDing,
I suspect you are using the code which is not compatible with the Tensorflow version you are using. tf.layers.dense is deprecated in the older versions. Could you please try to use tf.keras.layers.Dense instead. Also please try to convert the code into 2.x version.
https://www.tensorflow.org/api_docs/python/tf/keras/layers/Dense
Thank you!
from tensorflow.
import tensorflow as tf
Assuming first_token_tensor
and config
are already defined
self.pooled_output = tf.keras.layers.Dense(
config.hidden_size,
activation=tf.tanh,
kernel_initializer=tf.keras.initializers.RandomNormal(mean=0., stddev=config.initializer_range))(first_token_tensor)
try to change the code in this way
Thank you!
from tensorflow.
Thanks everyone, it's been solved.
from tensorflow.
Are you satisfied with the resolution of your issue?
Yes
No
from tensorflow.
Related Issues (20)
- AttributeError: module 'tensorflow' has no attribute 'layers' HOT 1
- Build TensorFlow for raspberry pi failed by ): relocation truncated to fit: R_AARCH64_CALL26 against symbol HOT 7
- Tensorflow.keras cannot be resolved HOT 8
- ImportError: Failed to load the native TensorFlow runtime due to undefined symbol HOT 3
- Deprecation warning when importing tensorflow HOT 2
- Issues in Tensorflow model training HOT 4
- Reduce TensorFlow Lite binary size HOT 2
- Consider dilation parameter support for Conv2dTranspose HOT 1
- Got unexpected result in special case for Conv2dTranspose HOT 5
- Compiling doesn't change learning rate of reloaded model. Instead changes learning-rate of optimizer HOT 1
- Silent exception when using TFLiteConverter
- When should I include tensorflow-lite-gpu-delegate-plugin dependency in my android project? HOT 3
- Urgent: Report of Spam and Scam Activity on Your Website HOT 4
- `SIGSEGV ` (Address boundary error) in `tf.io.gfile` with `TF_USE_MODULAR_FILESYSTEM=1` HOT 1
- error: enumeration value 'dnnl_data_type_undef' not handled in switch HOT 5
- `tf.data.Dataset.load()` cannot load from a folder with bracket in the name HOT 4
- ValueError: Only instances of `keras.Layer` can be added to a Sequential model. Received: <tensorflow_probability.python.layers.dense_variational_v2.DenseVariational object at 0x000001C67AF5B4D0> (of type <class 'tensorflow_probability.python.layers.dense_variational_v2.DenseVariational'>) HOT 1
- Failure loading saved model (with tf2onnx)
- TF 2.17.0-rc0 compilation fails due to flag: `-mavx512fp16’; did you mean ‘-mavx512bf16’? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tensorflow.