Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /home/frost/virtenv/nltk_scikitlearn/bin/python /home/frost/PycharmProjects/sentiment-analysis/sentimentAnalyseSocialMedia.py
- Using TensorFlow backend.
- ('Train: Shape of data_train tensor:', (11842, 1000))
- ('Train: Shape[0] of data_train tensor:', 11842)
- ('Train: Shape[1] of data_train tensor:', 1000)
- ('Predict: Shape of data_predict tensor:', (46962, 1000))
- ('Predict: Shape[0] of data_predict tensor:', 46962)
- ('Predict: Shape[1] of data_predict tensor:', 1000)
- ####
- Indices train
- [[ 0 0 0 ..., 1772 1310 42]
- [ 0 0 0 ..., 6 167 2804]
- [ 0 0 0 ..., 85 795 2]
- ...,
- [ 0 0 0 ..., 3772 63 69]
- [ 0 0 0 ..., 1036 11911 3863]
- [ 0 0 0 ..., 1124 568 566]]
- Indices Predict data
- [[ 0 0 0 ..., 6670 3036 13608]
- [ 0 0 0 ..., 4000 1350 74]
- [ 0 0 0 ..., 475 3527 1280]
- ...,
- [ 0 0 0 ..., 548 185 22]
- [ 0 0 0 ..., 1 15 22]
- [ 0 0 0 ..., 1 15 15588]]
- Type Train:
- [[ 0 0 0 ..., 1772 1310 42]
- [ 0 0 0 ..., 6 167 2804]
- [ 0 0 0 ..., 85 795 2]
- ...,
- [ 0 0 0 ..., 3772 63 69]
- [ 0 0 0 ..., 1036 11911 3863]
- [ 0 0 0 ..., 1124 568 566]]
- Type Predict:
- [[ 0 0 0 ..., 6670 3036 13608]
- [ 0 0 0 ..., 4000 1350 74]
- [ 0 0 0 ..., 475 3527 1280]
- ...,
- [ 0 0 0 ..., 548 185 22]
- [ 0 0 0 ..., 1 15 22]
- [ 0 0 0 ..., 1 15 15588]]
- Prediction shape:
- (11842, 3)
- Traceback (most recent call last):
- File "/home/frost/PycharmProjects/sentiment-analysis/sentimentAnalyseSocialMedia.py", line 477, in <module>
- predictSentiment()
- File "/home/frost/PycharmProjects/sentiment-analysis/sentimentAnalyseSocialMedia.py", line 466, in predictSentiment
- prediction_result_2 = trained_model_2.predict(data_predict, batch_size=128)
- File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/keras/engine/training.py", line 1268, in predict
- batch_size=batch_size, verbose=verbose)
- File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/keras/engine/training.py", line 946, in _predict_loop
- batch_outs = f(ins_batch)
- File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 1900, in __call__
- feed_dict=feed_dict)
- File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 766, in run
- run_metadata_ptr)
- File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 964, in _run
- feed_dict_string, options, run_metadata)
- File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1014, in _do_run
- target_list, options, run_metadata)
- File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1034, in _do_call
- raise type(e)(node_def, op, message)
- tensorflow.python.framework.errors_impl.InvalidArgumentError: indices[0,999] = 13608 is not in [0, 13480)
- [[Node: Gather_1 = Gather[Tindices=DT_INT32, Tparams=DT_FLOAT, validate_indices=true, _device="/job:localhost/replica:0/task:0/cpu:0"](embedding_1_W_1/read, _recv_input_1_1_0)]]
- Caused by op u'Gather_1', defined at:
- File "/home/frost/PycharmProjects/sentiment-analysis/sentimentAnalyseSocialMedia.py", line 477, in <module>
- predictSentiment()
- File "/home/frost/PycharmProjects/sentiment-analysis/sentimentAnalyseSocialMedia.py", line 465, in predictSentiment
- trained_model_2 = load_model("trained_model.h5")
- File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/keras/models.py", line 142, in load_model
- model = model_from_config(model_config, custom_objects=custom_objects)
- File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/keras/models.py", line 193, in model_from_config
- return layer_from_config(config, custom_objects=custom_objects)
- File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/keras/utils/layer_utils.py", line 41, in layer_from_config
- custom_objects=custom_objects)
- File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/keras/engine/topology.py", line 2582, in from_config
- process_layer(layer_data)
- File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/keras/engine/topology.py", line 2577, in process_layer
- layer(input_tensors[0])
- File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/keras/engine/topology.py", line 572, in __call__
- self.add_inbound_node(inbound_layers, node_indices, tensor_indices)
- File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/keras/engine/topology.py", line 635, in add_inbound_node
- Node.create_node(self, inbound_layers, node_indices, tensor_indices)
- File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/keras/engine/topology.py", line 166, in create_node
- output_tensors = to_list(outbound_layer.call(input_tensors[0], mask=input_masks[0]))
- File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/keras/layers/embeddings.py", line 128, in call
- out = K.gather(W, x)
- File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 936, in gather
- return tf.gather(reference, indices)
- File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 1293, in gather
- validate_indices=validate_indices, name=name)
- File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 759, in apply_op
- op_def=op_def)
- File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2240, in create_op
- original_op=self._default_original_op, op_def=op_def)
- File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1128, in __init__
- self._traceback = _extract_stack()
- InvalidArgumentError (see above for traceback): indices[0,999] = 13608 is not in [0, 13480)
- [[Node: Gather_1 = Gather[Tindices=DT_INT32, Tparams=DT_FLOAT, validate_indices=true, _device="/job:localhost/replica:0/task:0/cpu:0"](embedding_1_W_1/read, _recv_input_1_1_0)]]
- Process finished with exit code 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement