Skip to content

Commit

Permalink
Fixing arguments that are allowed to differ for training continuation (
Browse files Browse the repository at this point in the history
…#610)

Fixing typos introduced in #581 and adding a small test to prevent similar errors.
  • Loading branch information
artemsok authored and fhieber committed Dec 19, 2018
1 parent eafb3bb commit 390acde
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Note that Sockeye has checks in place to not translate with an old model that wa

Each version section may have have subsections for: _Added_, _Changed_, _Removed_, _Deprecated_, and _Fixed_.

## [1.18.66]
### Fixed
- Fix to argument names that are allowed to differ for resuming training.

## [1.18.65]
### Changed
- More informative error message about inconsistent --shared-vocab setting.
Expand Down
2 changes: 1 addition & 1 deletion sockeye/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.

__version__ = '1.18.65'
__version__ = '1.18.66'
8 changes: 4 additions & 4 deletions sockeye/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,12 @@
ARGS_STATE_NAME = "args.yaml"

# Arguments that may differ and still resume training
ARGS_MAY_DIFFER = ["overwrite_output", "use-tensorboard", "quiet",
ARGS_MAY_DIFFER = ["overwrite_output", "use_tensorboard", "quiet",
"align_plot_prefix", "sure_align_threshold",
"keep_last_params", "seed",
"max-updates", "min-updates",
"max-num-epochs", "min-num-epochs",
"max-samples", "min-samples"]
"max_updates", "min_updates",
"max_num_epochs", "min_num_epochs",
"max_samples", "min_samples"]

# Other argument constants
TRAINING_ARG_SOURCE = "--source"
Expand Down
5 changes: 5 additions & 0 deletions test/unit/test_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import pytest
import tempfile
import os
import re
import yaml

import sockeye.arguments as arguments
Expand Down Expand Up @@ -509,3 +510,7 @@ def test_config_file_required(config_command_line, config_contents):
# Parse args and cast to dicts directly
config_file_argparse.parse_args(
args=(config_command_line + (" --config %s" % fp.name)).split())

def test_arguments_allowed_to_differ():
for arg in C.ARGS_MAY_DIFFER:
assert re.match(r'^[a-zA-Z0-9_]*$', arg)

0 comments on commit 390acde

Please sign in to comment.