Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions deeppavlov/core/common/chainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ def _compute(*args, param_names, pipe, targets):
final_pipe.append(((in_keys, in_params), out_params, component))
final_pipe.reverse()
if not expected.issubset(param_names):
raise RuntimeError(f'{expected} are required to compute {targets} but were not found in memory or inputs')
missing_params = [k for k in expected if k not in param_names]
raise RuntimeError(f'{missing_params} are required to compute {targets} but were not found in memory or inputs')
pipe = final_pipe

mem = dict(zip(param_names, args))
Expand All @@ -232,8 +233,10 @@ def _compute(*args, param_names, pipe, targets):
mem[out_params[0]] = res
else:
mem.update(zip(out_params, res))

res = [mem[k] for k in targets]
try:
res = [mem[k] for k in targets]
except Exception as e:
raise Exception(f'In memory {mem.keys()} targets {targets}: {e}')
if len(res) == 1:
res = res[0]
return res
Expand Down