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 tried to set Params.max_passage_count to 1 and write a method for getting word embedding that matches the shape of INPUT from passage_ids and question_ids and model.fit, but I encountered the following gradient error.
class Embedding:
...
def get_word_emb(self, ids):
return [getattr(self, "_word_emb")[i] for i in ids]
...
def get_batch(mode="train"):
data, shapes = load_data("../dev.json")
input_queue = tf.train.slice_input_producer(data, shuffle=False)
batch = tf.train.batch(input_queue, num_threads=2,
batch_size=Params.batch_size, capacity=Params.batch_size * 32, dynamic_pad=True)
return batch
Error
Traceback (most recent call last):
File "model.py", line 72, in <module>
Vnet()
File "model.py", line 65, in __init__
model.fit(get_batch("dev"), batch_size=Params.batch_size, epochs=Params.num_epochs, verbose=1)
File "/anaconda3/lib/python3.7/site-packages/keras/engine/training.py", line 1010, in fit
self._make_train_function()
File "/anaconda3/lib/python3.7/site-packages/keras/engine/training.py", line 509, in _make_train_function
loss=self.total_loss)
File "/anaconda3/lib/python3.7/site-packages/keras/legacy/interfaces.py", line 91, in wrapper
return func(*args, **kwargs)
File "/anaconda3/lib/python3.7/site-packages/keras/optimizers.py", line 475, in get_updates
grads = self.get_gradients(loss, params)
File "/anaconda3/lib/python3.7/site-packages/keras/optimizers.py", line 91, in get_gradients
raise ValueError('An operation has `None` for gradient. '
ValueError: An operation has `None` for gradient. Please make sure that all of your ops have a gradient defined (i.e. are differentiable). Common ops without gradient: K.argmax, K.round, K.eval.
It looks like verify_loss is being implemented, is it?
src/loss_functions.py
Hi!
I tried to set
Params.max_passage_count
to1
and write a method for getting word embedding that matches the shape of INPUT frompassage_ids
andquestion_ids
andmodel.fit
, but I encountered the following gradient error.src/model.py
src/data_load.py
Error
It looks like
verify_loss
is being implemented, is it?src/loss_functions.py
The text was updated successfully, but these errors were encountered: