awslabs / sockeye

Sequence-to-sequence framework with a focus on Neural Machine Translation based on PyTorch
https://awslabs.github.io/sockeye/
Apache License 2.0
1.21k stars 323 forks source link

import error on train CLI #78

Closed cherryc closed 7 years ago

cherryc commented 7 years ago

First commit that exhibits the error: 34748cb

Error: Training the model... Traceback (most recent call last): File "/Users/cherryc/nlp/jsalt/git/upstream/sockeye/sockeye/train.py", line 32, in from . import arguments ImportError: cannot import name 'arguments'

Command: PYTHONPATH=$SOCKEYE python3 $SOCKEYE/sockeye/train.py \ --source data/multi30k/train-toy.$1.atok \ --target data/multi30k/train-toy.$2.atok \ --validation-source data/multi30k/val.$1.atok \ --validation-target data/multi30k/val.$2.atok \ --word-min-count 2 \ --rnn-num-layers 1 \ --rnn-cell-type gru \ --rnn-num-hidden 64 \ --num-embed-source 64 \ --num-embed-target 64 \ --attention-type mlp \ --attention-num-hidden 64 \ --batch-size 64 \ --normalize-loss \ --dropout 0.1 \ --optimizer adam \ --initial-learning-rate 0.001 \ --use-cpu \ --output models/multi30k-$1-$2/baseline

davvil commented 7 years ago

You should call train, and other CLI tools, as modules, i.e. "PYTHONPATH=$SOCKEYE python3 -m sockeye.train ". Calling directly train.py generates the import error you are seeing.

It may have been the case that direct invocation worked before, but it was not explicitly supported.

cherryc commented 7 years ago

That fixed it, thanks.