when I run:
def _debug(self, model, sliced_data, output):
for i, item in enumerate(tqdm.tqdm(sliceddata)):
(, history), = model.compute_loss([item], debug=True)
output.write(
json.dumps({
'index': i,
'history': history,
}) + '\n')
output.flush()
def compute_loss(self, enc_input, example, desc_enc, debug):
if not (self.enumerate_order and self.training):
mle_loss = self.compute_mle_loss(enc_input, example, desc_enc, debug)
else:
mle_loss = self.compute_loss_from_all_ordering(enc_input, example, desc_enc, debug)
if self.use_align_loss:
align_loss = self.compute_align_loss(desc_enc, example)
**return mle_loss + align_loss**
return mle_loss
when I run: def _debug(self, model, sliced_data, output): for i, item in enumerate(tqdm.tqdm(sliceddata)): (, history), = model.compute_loss([item], debug=True) output.write( json.dumps({ 'index': i, 'history': history, }) + '\n') output.flush()
This error appeared.I don't know how to fix it