Advertisement
Guest User

sentiment-output

a guest
Feb 18th, 2017
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.67 KB | None | 0 0
  1. /home/frost/virtenv/nltk_scikitlearn/bin/python /home/frost/PycharmProjects/sentiment-analysis/sentimentAnalyseSocialMedia.py
  2. Using TensorFlow backend.
  3. ('Train: Shape of data_train tensor:', (11842, 1000))
  4. ('Train: Shape[0] of data_train tensor:', 11842)
  5. ('Train: Shape[1] of data_train tensor:', 1000)
  6. ('Predict: Shape of data_predict tensor:', (46962, 1000))
  7. ('Predict: Shape[0] of data_predict tensor:', 46962)
  8. ('Predict: Shape[1] of data_predict tensor:', 1000)
  9. ####
  10. Indices train
  11. [[ 0 0 0 ..., 1772 1310 42]
  12. [ 0 0 0 ..., 6 167 2804]
  13. [ 0 0 0 ..., 85 795 2]
  14. ...,
  15. [ 0 0 0 ..., 3772 63 69]
  16. [ 0 0 0 ..., 1036 11911 3863]
  17. [ 0 0 0 ..., 1124 568 566]]
  18. Indices Predict data
  19. [[ 0 0 0 ..., 6670 3036 13608]
  20. [ 0 0 0 ..., 4000 1350 74]
  21. [ 0 0 0 ..., 475 3527 1280]
  22. ...,
  23. [ 0 0 0 ..., 548 185 22]
  24. [ 0 0 0 ..., 1 15 22]
  25. [ 0 0 0 ..., 1 15 15588]]
  26. Type Train:
  27. [[ 0 0 0 ..., 1772 1310 42]
  28. [ 0 0 0 ..., 6 167 2804]
  29. [ 0 0 0 ..., 85 795 2]
  30. ...,
  31. [ 0 0 0 ..., 3772 63 69]
  32. [ 0 0 0 ..., 1036 11911 3863]
  33. [ 0 0 0 ..., 1124 568 566]]
  34. Type Predict:
  35. [[ 0 0 0 ..., 6670 3036 13608]
  36. [ 0 0 0 ..., 4000 1350 74]
  37. [ 0 0 0 ..., 475 3527 1280]
  38. ...,
  39. [ 0 0 0 ..., 548 185 22]
  40. [ 0 0 0 ..., 1 15 22]
  41. [ 0 0 0 ..., 1 15 15588]]
  42. Prediction shape:
  43. (11842, 3)
  44. Traceback (most recent call last):
  45. File "/home/frost/PycharmProjects/sentiment-analysis/sentimentAnalyseSocialMedia.py", line 477, in <module>
  46. predictSentiment()
  47. File "/home/frost/PycharmProjects/sentiment-analysis/sentimentAnalyseSocialMedia.py", line 466, in predictSentiment
  48. prediction_result_2 = trained_model_2.predict(data_predict, batch_size=128)
  49. File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/keras/engine/training.py", line 1268, in predict
  50. batch_size=batch_size, verbose=verbose)
  51. File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/keras/engine/training.py", line 946, in _predict_loop
  52. batch_outs = f(ins_batch)
  53. File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 1900, in __call__
  54. feed_dict=feed_dict)
  55. File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 766, in run
  56. run_metadata_ptr)
  57. File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 964, in _run
  58. feed_dict_string, options, run_metadata)
  59. File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1014, in _do_run
  60. target_list, options, run_metadata)
  61. File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1034, in _do_call
  62. raise type(e)(node_def, op, message)
  63. tensorflow.python.framework.errors_impl.InvalidArgumentError: indices[0,999] = 13608 is not in [0, 13480)
  64. [[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)]]
  65.  
  66. Caused by op u'Gather_1', defined at:
  67. File "/home/frost/PycharmProjects/sentiment-analysis/sentimentAnalyseSocialMedia.py", line 477, in <module>
  68. predictSentiment()
  69. File "/home/frost/PycharmProjects/sentiment-analysis/sentimentAnalyseSocialMedia.py", line 465, in predictSentiment
  70. trained_model_2 = load_model("trained_model.h5")
  71. File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/keras/models.py", line 142, in load_model
  72. model = model_from_config(model_config, custom_objects=custom_objects)
  73. File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/keras/models.py", line 193, in model_from_config
  74. return layer_from_config(config, custom_objects=custom_objects)
  75. File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/keras/utils/layer_utils.py", line 41, in layer_from_config
  76. custom_objects=custom_objects)
  77. File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/keras/engine/topology.py", line 2582, in from_config
  78. process_layer(layer_data)
  79. File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/keras/engine/topology.py", line 2577, in process_layer
  80. layer(input_tensors[0])
  81. File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/keras/engine/topology.py", line 572, in __call__
  82. self.add_inbound_node(inbound_layers, node_indices, tensor_indices)
  83. File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/keras/engine/topology.py", line 635, in add_inbound_node
  84. Node.create_node(self, inbound_layers, node_indices, tensor_indices)
  85. File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/keras/engine/topology.py", line 166, in create_node
  86. output_tensors = to_list(outbound_layer.call(input_tensors[0], mask=input_masks[0]))
  87. File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/keras/layers/embeddings.py", line 128, in call
  88. out = K.gather(W, x)
  89. File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 936, in gather
  90. return tf.gather(reference, indices)
  91. File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 1293, in gather
  92. validate_indices=validate_indices, name=name)
  93. File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 759, in apply_op
  94. op_def=op_def)
  95. File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2240, in create_op
  96. original_op=self._default_original_op, op_def=op_def)
  97. File "/home/frost/virtenv/nltk_scikitlearn/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1128, in __init__
  98. self._traceback = _extract_stack()
  99.  
  100. InvalidArgumentError (see above for traceback): indices[0,999] = 13608 is not in [0, 13480)
  101. [[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)]]
  102.  
  103.  
  104. Process finished with exit code 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement