You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to run pretrained models as shown in README, namely:
url = 'https://s3-ap-northeast-1.amazonaws.com/dev.tech-sketch.jp/chakki/public/conll2003_en.zip'
weights, params, preprocessor = anago.utils.download(url)
model = anago.Sequence.load(weights, params, preprocessor)
text = 'President Obama is speaking at the White House .'
res = model.analyze(text)
and receive the following error (future warnings have been silenced):
Using TensorFlow backend.
/tmp/test-anago/venv-1.0.8/lib/python3.6/site-packages/sklearn/externals/joblib/__init__.py:15: DeprecationWarning: sklearn.externals.joblib is deprecated in 0.21 and will be removed in 0.23. Please import this functionality directly from joblib, which can be installed with: pip install joblib. If this warning is raised when loading pickled models, you may need to re-serialize those models with scikit-learn 0.21+.
warnings.warn(msg, category=DeprecationWarning)
WARNING: Logging before flag parsing goes to stderr.
W0827 17:33:44.624381 140560557238080 deprecation_wrapper.py:119] From /tmp/test-anago/venv-1.0.8/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:541: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.
W0827 17:33:44.635842 140560557238080 deprecation_wrapper.py:119] From /tmp/test-anago/venv-1.0.8/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:66: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.
W0827 17:33:44.646406 140560557238080 deprecation_wrapper.py:119] From /tmp/test-anago/venv-1.0.8/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:4432: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.
W0827 17:33:44.847993 140560557238080 deprecation.py:323] From /tmp/test-anago/venv-1.0.8/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:3239: add_dispatch_support.<locals>.wrapper (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.where in 2.0, which has the same broadcast rule as np.where
W0827 17:33:45.003281 140560557238080 deprecation_wrapper.py:119] From /tmp/test-anago/venv-1.0.8/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:148: The name tf.placeholder_with_default is deprecated. Please use tf.compat.v1.placeholder_with_default instead.
W0827 17:33:45.008451 140560557238080 deprecation.py:506] From /tmp/test-anago/venv-1.0.8/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py:3733: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.
Instructions for updating:
Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob`.
Traceback (most recent call last):
File "/tmp/test-anago/venv-1.0.8/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 471, in _apply_op_helper
as_ref=input_arg.is_ref)
File "/tmp/test-anago/venv-1.0.8/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1293, in internal_convert_n_to_tensor
ctx=ctx))
File "/tmp/test-anago/venv-1.0.8/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1224, in internal_convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "/tmp/test-anago/venv-1.0.8/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1018, in _TensorTensorConversionFunction
(dtype.name, t.dtype.name, str(t)))
ValueError: Tensor conversion requested dtype bool for Tensor with dtype float32: 'Tensor("crf_1/zeros_like_4:0", shape=(?, ?), dtype=float32)'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./test_02.py", line 21, in <module>
model = anago.Sequence.load(weights, params, preprocessor)
File "/tmp/test-anago/venv-1.0.8/lib/python3.6/site-packages/anago/wrapper.py", line 140, in load
self.model = load_model(weights, params)
File "/tmp/test-anago/venv-1.0.8/lib/python3.6/site-packages/anago/models.py", line 22, in load_model
model = model_from_json(f.read(), custom_objects={'CRF': CRF})
File "/tmp/test-anago/venv-1.0.8/lib/python3.6/site-packages/keras/engine/saving.py", line 627, in model_from_json
return deserialize(config, custom_objects=custom_objects)
File "/tmp/test-anago/venv-1.0.8/lib/python3.6/site-packages/keras/layers/__init__.py", line 168, in deserialize
printable_module_name='layer')
File "/tmp/test-anago/venv-1.0.8/lib/python3.6/site-packages/keras/utils/generic_utils.py", line 147, in deserialize_keras_object
list(custom_objects.items())))
File "/tmp/test-anago/venv-1.0.8/lib/python3.6/site-packages/keras/engine/network.py", line 1062, in from_config
process_node(layer, node_data)
File "/tmp/test-anago/venv-1.0.8/lib/python3.6/site-packages/keras/engine/network.py", line 1012, in process_node
layer(unpack_singleton(input_tensors), **kwargs)
File "/tmp/test-anago/venv-1.0.8/lib/python3.6/site-packages/keras/engine/base_layer.py", line 451, in __call__
output = self.call(inputs, **kwargs)
File "/tmp/test-anago/venv-1.0.8/lib/python3.6/site-packages/anago/layers.py", line 215, in call
test_output = self.viterbi_decoding(X, mask)
File "/tmp/test-anago/venv-1.0.8/lib/python3.6/site-packages/anago/layers.py", line 484, in viterbi_decoding
argmin_tables = self.recursion(input_energy, mask, return_logZ=False)
File "/tmp/test-anago/venv-1.0.8/lib/python3.6/site-packages/anago/layers.py", line 445, in recursion
mask2 = K.cast(K.concatenate([mask, K.zeros_like(mask[:, :1])], axis=1), K.floatx())
File "/tmp/test-anago/venv-1.0.8/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2176, in concatenate
return tf.concat([to_dense(x) for x in tensors], axis)
File "/tmp/test-anago/venv-1.0.8/lib/python3.6/site-packages/tensorflow/python/util/dispatch.py", line 180, in wrapper
return target(*args, **kwargs)
File "/tmp/test-anago/venv-1.0.8/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 1299, in concat
return gen_array_ops.concat_v2(values=values, axis=axis, name=name)
File "/tmp/test-anago/venv-1.0.8/lib/python3.6/site-packages/tensorflow/python/ops/gen_array_ops.py", line 1256, in concat_v2
"ConcatV2", values=values, axis=axis, name=name)
File "/tmp/test-anago/venv-1.0.8/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 499, in _apply_op_helper
raise TypeError("%s that don't all match." % prefix)
TypeError: Tensors in list passed to 'values' of 'ConcatV2' Op have types [bool, float32] that don't all match.
Could you help me understand what i am doing wrong?
Thanks in advance,
Nikolai
The text was updated successfully, but these errors were encountered:
System information
Problem
I try to run pretrained models as shown in README, namely:
and receive the following error (future warnings have been silenced):
Could you help me understand what i am doing wrong?
Thanks in advance,
Nikolai
The text was updated successfully, but these errors were encountered: