Traceback (most recent call last):
File "", line 4, in
File "/home/clin/env/local/lib/python2.7/site-packages/mittens/mittens_base.py", line 84, in fit
fixed_initialization=fixed_initialization)
File "/home/clin/env/local/lib/python2.7/site-packages/mittens/tf_mittens.py", line 61, in _fit
self.cost = self._get_cost_function()
File "/home/clin/env/local/lib/python2.7/site-packages/mittens/tf_mittens.py", line 168, in _get_cost_function
if self.mittens > 0:
File "/home/clin/env/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 542, in nonzero
raise TypeError("Using a tf.Tensor as a Python bool is not allowed. "
TypeError: Using a tf.Tensor as a Python bool is not allowed. Use if t is not None: instead of if t: to test if a tensor is defined, and use TensorFlow ops such as tf.cond to execute subgraphs conditioned on the value of a tensor.
I am trying to using mittens to fit for a target domain, but met the following errors:
new_embed = mittens_model.fit( ... comatrix, ... vocab=id2word_cooc, ... initial_embedding_dict= old_embed)
Traceback (most recent call last): File "", line 4, in
File "/home/clin/env/local/lib/python2.7/site-packages/mittens/mittens_base.py", line 84, in fit
fixed_initialization=fixed_initialization)
File "/home/clin/env/local/lib/python2.7/site-packages/mittens/tf_mittens.py", line 61, in _fit
self.cost = self._get_cost_function()
File "/home/clin/env/local/lib/python2.7/site-packages/mittens/tf_mittens.py", line 168, in _get_cost_function
if self.mittens > 0:
File "/home/clin/env/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 542, in nonzero
raise TypeError("Using a
tf.Tensor
as a Pythonbool
is not allowed. " TypeError: Using atf.Tensor
as a Pythonbool
is not allowed. Useif t is not None:
instead ofif t:
to test if a tensor is defined, and use TensorFlow ops such as tf.cond to execute subgraphs conditioned on the value of a tensor.