Comments (3)
same here +1
from twitter-sentiment-analysis.
Similar error
/usr/local/lib/python3.6/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float
to np.floating
is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type
.
from ._conv import register_converters as _register_converters
Using TensorFlow backend.
/usr/local/lib/python3.6/site-packages/keras/preprocessing/text.py:172: UserWarning: The nb_words
argument in Tokenizer
has been renamed num_words
.
warnings.warn('The nb_words
argument in Tokenizer
'
/usr/local/lib/python3.6/site-packages/keras/engine/topology.py:1271: UserWarning: The dropout
argument is no longer support in Embedding
. You can apply a keras.layers.SpatialDropout1D
layer right after the Embedding
layer to get the same behavior.
return cls(**config)
/usr/local/lib/python3.6/site-packages/keras/engine/topology.py:1271: UserWarning: Update your Embedding
call to the Keras 2 API: Embedding(trainable=False, name="embedding_1", activity_regularizer=None, input_dtype="int32", mask_zero=False, input_dim=20000, batch_input_shape=[None, 100..., output_dim=200, input_length=1000, embeddings_initializer="uniform", embeddings_regularizer=None, embeddings_constraint=None)
return cls(**config)
Traceback (most recent call last):
File "predict.py", line 41, in
main()
File "predict.py", line 20, in main
model = load_model('model.h5')
File "/usr/local/lib/python3.6/site-packages/keras/models.py", line 270, in load_model
model = model_from_config(model_config, custom_objects=custom_objects)
File "/usr/local/lib/python3.6/site-packages/keras/models.py", line 347, in model_from_config
return layer_module.deserialize(config, custom_objects=custom_objects)
File "/usr/local/lib/python3.6/site-packages/keras/layers/init.py", line 55, in deserialize
printable_module_name='layer')
File "/usr/local/lib/python3.6/site-packages/keras/utils/generic_utils.py", line 144, in deserialize_keras_object
list(custom_objects.items())))
File "/usr/local/lib/python3.6/site-packages/keras/models.py", line 1412, in from_config
model.add(layer)
File "/usr/local/lib/python3.6/site-packages/keras/models.py", line 497, in add
layer(x)
File "/usr/local/lib/python3.6/site-packages/keras/engine/topology.py", line 592, in call
self.build(input_shapes[0])
File "/usr/local/lib/python3.6/site-packages/keras/layers/embeddings.py", line 105, in build
dtype=self.dtype)
File "/usr/local/lib/python3.6/site-packages/keras/legacy/interfaces.py", line 91, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/keras/engine/topology.py", line 416, in add_weight
constraint=constraint)
File "/usr/local/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 396, in variable
v = tf.Variable(value, dtype=tf.as_dtype(dtype), name=name)
File "/usr/local/lib/python3.6/site-packages/tensorflow/python/ops/variables.py", line 235, in init
constraint=constraint)
File "/usr/local/lib/python3.6/site-packages/tensorflow/python/ops/variables.py", line 355, in _init_from_args
initial_value, name="initial_value", dtype=dtype)
File "/usr/local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1014, in convert_to_tensor
as_ref=False)
File "/usr/local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1104, in internal_convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "/usr/local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 947, in _TensorTensorConversionFunction
(dtype.name, t.dtype.name, str(t)))
ValueError: Tensor conversion requested dtype int32 for Tensor with dtype float32: 'Tensor("embedding_1/random_uniform:0", shape=(20000, 200), dtype=float32)'
from twitter-sentiment-analysis.
We should have same version of keras installed in your system and the trained model.
from twitter-sentiment-analysis.
Related Issues (5)
- freeze the graph
- ValueError: Tensor conversion requested dtype int32 for Tensor with dtype float32: 'Tensor("embedding_1/random_uniform:0", shape=(20000, 200), dtype=float32)' HOT 2
- _csv.Error: iterator should return strings, not bytes (did you open the file in text mode?) HOT 2
- doubt regarding files used
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 twitter-sentiment-analysis.