tensorflow / nmt

TensorFlow Neural Machine Translation Tutorial
Apache License 2.0
6.36k stars 1.96k forks source link

version check in misc_utils.py failed in tensorflow 1.10.xxx #367

Open hkhpub opened 6 years ago

hkhpub commented 6 years ago

It checks version by comparing version strings, so from version 1.10, the check does not work any more.

def check_tensorflow_version():
  min_tf_version = "1.4.0-dev20171024"
  if tf.__version__ < min_tf_version:
    raise EnvironmentError("Tensorflow version must >= %s" % min_tf_version)
VictorZhang2014 commented 6 years ago

This is resolved in a Pull Request. https://github.com/tensorflow/nmt/pull/369 It's impossible valid immediately while NMT team generate a release.

hkhpub commented 6 years ago

This should be a temporal workaround:

from distutils.version import StrictVersion

def check_tensorflow_version():
  min_tf_version = "1.4.0"
  if StrictVersion(tf.__version__) < StrictVersion(min_tf_version):
    raise EnvironmentError("Tensorflow version must >= %s" % min_tf_version)