monoses
monoses copied to clipboard
Step5 induce_phrase_table problem
Thank you for your sharing.I trained to the fifth step and there was a problem.
Traceback (most recent call last):
File "monoses/training/induce-phrase-table.py", line 153, in
I have the same problem.
Traceback (most recent call last):
File "/home/ubuntu/liu/demo/monoses-master/third-party/vecmap/map_embeddings.py", line 422, in
@yaoyao2 did you manage to solve this? I'm having the same problem
You can fix this by changing:
print('Optimizing temperature | Progress: {:.2%} | Temperature: {:.2f} | Loss: {:.2f}'
.format((epoch + j/n)/args.epochs, t.detach().cpu().numpy(), loss.detach().cpu().numpy()),
file=sys.stderr)
to
print('Optimizing temperature | Progress: {:.2%} | Temperature: {:.2f} | Loss: {:.2f}'
.format((epoch + j/n)/args.epochs,
float(np.array2string(t.detach().cpu().numpy())),
float(np.array2string(loss.detach().cpu().numpy()))),
file=sys.stderr)
in training/induce-phrase-table.py
Did you manage to solve this problem? I tried the solution indicated by @kellymarchisio but it didn't work for me. Here's my error message:
/Desktop/monoses-master/third-party/vecmap/map_embeddings.py:301: RuntimeWarning: divide by zero encountered in true_divide
return vt.T.dot(xp.diag(1/s)).dot(vt)
Traceback (most recent call last):
File "/Desktop/monoses-master/third-party/vecmap/map_embeddings.py", line 422, in
To solve, try to change in map_embeddings.py in third_parties/vecmap the function whitening_transformation at line 298 with the following. It adds a small number epsilon to s to avoid division by zero. On top of that, be sure that your corpora are formatted properly.
def whitening_transformation(m):
u, s, vt = xp.linalg.svd(m, full_matrices=False)
# Whitening constant: prevents division by zero
epsilon = 0.002
return vt.T.dot(xp.diag(1/(s + epsilon))).dot(vt)
Hello,
I have made all the changes above suggested. But still getting error. Here is my error message:
/usr/local/lib/python3.6/dist-packages/torch/nn/_reduction.py:43: UserWarning: size_average and reduce args will be deprecated, please use reduction='mean' instead.
warnings.warn(warning.format(ret))
Optimizing temperature | Progress: 20000.00% | Temperature: 1.00 | Loss: 7.97
Traceback (most recent call last):
File "/content/monoses/training/induce-phrase-table.py", line 155, in
I got the error too!
FileNotFoundError: [Errno 2] No such file or directory: 'exp/enes//step4/emb.src' sort: cannot read: exp/enes/tmpksyk_67i/src2trg.phrase-table: No such file or directory Traceback (most recent call last): File "train.py", line 484, in <module> main() File "train.py", line 474, in main induce_phrase_table(args) File "train.py", line 317, in induce_phrase_table os.remove(args.tmp + '/' + part + '.phrase-table') FileNotFoundError: [Errno 2] No such file or directory: 'exp/enes/tmpksyk_67i/src2trg.phrase-table'
@fallcat @shefs0709 - I had this issue when the automatically-created temp folder got deleted before the file could be read again. it was ages ago, but I believe I solved it by just changing to writing to a regular directory I made instead of a python tempdir