Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid argument when calculating sim_predictor.senmantic_sim() #14

Open
tyz98 opened this issue Mar 23, 2020 · 1 comment
Open

Invalid argument when calculating sim_predictor.senmantic_sim() #14

tyz98 opened this issue Mar 23, 2020 · 1 comment

Comments

@tyz98
Copy link

tyz98 commented Mar 23, 2020

I'm able to load the USE model, but when running sim_predictor.senmantic_sim(), there is an error as below. How can I fix this?
2020-03-23 05:50:07.614773: W tensorflow/core/framework/op_kernel.cc:1622] OP_REQUIRES failed at sparse_to_dense_op.cc:128: Invalid argument: indices[16] = [0,16] is out of bounds: need 0 <= index < [49,16]
2020-03-23 05:50:07.614887: W tensorflow/core/common_runtime/base_collective_executor.cc:216] BaseCollectiveExecutor::StartAbort Invalid argument: indices[16] = [0,16] is out of bounds: need 0 <= index < [49,16]
[[{{node text_preprocessor/SparseToDense}}]]
[[Encoder_en/Transformer/PrepareForTransformer/embedding_lookup/DynamicPartition/58]]
2020-03-23 05:50:07.615180: W tensorflow/core/common_runtime/base_collective_executor.cc:216] BaseCollectiveExecutor::StartAbort Invalid argument: indices[16] = [0,16] is out of bounds: need 0 <= index < [49,16]
[[{{node text_preprocessor/SparseToDense}}]]
Traceback (most recent call last):
File "attack_classification.py", line 622, in
main()
File "attack_classification.py", line 590, in main
batch_size=args.batch_size)
File "attack_classification.py", line 281, in attack
embeddings1 = sim_predictor(sent1)
File "/usr/local/miniconda3/envs/dl/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/base_layer.py", line891, in call
outputs = self.call(cast_inputs, *args, **kwargs)
File "/usr/local/miniconda3/envs/dl/lib/python3.6/site-packages/tensorflow_hub/keras_layer.py", line 209, in call
result = f()
File "/usr/local/miniconda3/envs/dl/lib/python3.6/site-packages/tensorflow_core/python/eager/function.py", line 1081, in__call
_
return self._call_impl(args, kwargs)
File "/usr/local/miniconda3/envs/dl/lib/python3.6/site-packages/tensorflow_core/python/eager/function.py", line 1121, in_call_impl
return self._call_flat(args, self.captured_inputs, cancellation_manager)
File "/usr/local/miniconda3/envs/dl/lib/python3.6/site-packages/tensorflow_core/python/eager/function.py", line 1224, in_call_flat
ctx, args, cancellation_manager=cancellation_manager)
File "/usr/local/miniconda3/envs/dl/lib/python3.6/site-packages/tensorflow_core/python/eager/function.py", line 511, in call
ctx=ctx)
File "/usr/local/miniconda3/envs/dl/lib/python3.6/site-packages/tensorflow_core/python/eager/execute.py", line 67, in quick_execute
six.raise_from(core._status_to_exception(e.code, message), None)
File "", line 3, in raise_from
tensorflow.python.framework.errors_impl.InvalidArgumentError: 2 root error(s) found.
(0) Invalid argument: indices[16] = [0,16] is out of bounds: need 0 <= index < [49,16]
[[node text_preprocessor/SparseToDense (defined at /usr/local/miniconda3/envs/dl/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py:1751) ]]
[[Encoder_en/Transformer/PrepareForTransformer/embedding_lookup/DynamicPartition/_58]]
(1) Invalid argument: indices[16] = [0,16] is out of bounds: need 0 <= index < [49,16]
[[node text_preprocessor/SparseToDense (defined at /usr/local/miniconda3/envs/dl/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py:1751) ]]
0 successful operations.
0 derived errors ignored. [Op:__inference_pruned_6865]

Function call stack:
pruned -> pruned

@jind11
Copy link
Owner

jind11 commented Mar 23, 2020

hi, have you successfully installed USE at your environment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants