lvapeab / nmt-keras

Neural Machine Translation with Keras
http://nmt-keras.readthedocs.io
MIT License
533 stars 130 forks source link

Error while Training #94

Closed KushalDave closed 5 years ago

KushalDave commented 5 years ago

Hi, I am trying to run your code with the default settings (I do not change anything) and run it on the data given on github with all default settings. I get the following error:

[17/01/2019 15:57:49] $HOME=C:\Users\dkay [17/01/2019 15:57:49] CONFIGDIR=C:\Users\dkay.matplotlib [17/01/2019 15:57:49] matplotlib data path: C:\Program Files\Python35\lib\site-packages\matplotlib\mpl-data [17/01/2019 15:57:49] loaded rc file C:\Program Files\Python35\lib\site-packages\matplotlib\mpl-data\matplotlibrc [17/01/2019 15:57:49] matplotlib version 3.0.2 [17/01/2019 15:57:49] interactive is False [17/01/2019 15:57:49] platform is win32 [17/01/2019 15:57:49] loaded modules: ['mp_main', '_bisect', 'unittest.suite', '_weakref', 'numpy.polynomial.legendre', 'tables.group', 'importlib.machinery encoder', 'encodings.aliases', '_ctypes', 'pyparsing', 'numpy.lib.nanfunctions', 'email.feedparser', 'numpy.lib._iotools', 'numpy.fft.fftpack_lite', 'pkg_resour Using TensorFlow backend. Traceback (most recent call last): File "D:\dkay\EEM\Code\nmt-keras\nmt-keras\nmt-keras\main.py", line 11, in from nmt_keras.training import train_model File "D:\dkay\EEM\Code\nmt-keras\nmt-keras\nmt-keras\nmt_keras\training.py", line 10, in from keras_wrapper.cnn_model import updateModel File "d:\dkay\python\python3.5.4\src\keras-wrapper\keras_wrapper\cnn_model.py", line 15, in import keras File "d:\dkay\python\python3.5.4\src\keras\keras__init.py", line 3, in from . import utils File "d:\dkay\python\python3.5.4\src\keras\keras\utils__init.py", line 6, in from . import conv_utils File "d:\dkay\python\python3.5.4\src\keras\keras\utils\conv_utils.py", line 9, in from .. import backend as K File "d:\dkay\python\python3.5.4\src\keras\keras\backend\init.py", line 92, in from .tensorflow_backend import * File "d:\dkay\python\python3.5.4\src\keras\keras\backend\tensorflow_backend.py", line 5, in import tensorflow as tf File "C:\Program Files\Python35\lib\site-packages\tensorflow\init__.py", line 24, in from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import File "C:\Program Files\Python35\lib\site-packages\tensorflow\python\init.py", line 88, in from tensorflow.python import keras File "C:\Program Files\Python35\lib\site-packages\tensorflow\python\keras\init__.py", line 24, in from tensorflow.python.keras import activations File "C:\Program Files\Python35\lib\site-packages\tensorflow\python\keras\activations.py", line 24, in from tensorflow.python.keras.utils.generic_utils import deserialize_keras_object File "C:\Program Files\Python35\lib\site-packages\tensorflow\python\keras\utils\init.py", line 32, in from tensorflow.python.keras.utils.io_utils import HDF5Matrix File "C:\Program Files\Python35\lib\site-packages\tensorflow\python\keras\utils\io_utils.py", line 29, in import h5py File "C:\Program Files\Python35\lib\site-packages\h5py\init__.py", line 36, in from ._conv import register_converters as _register_converters File "h5py\h5r.pxd", line 21, in init h5py._conv File "h5py\h5r.pyx", line 145, in init h5py.h5r AttributeError: type object 'h5py.h5r.Reference' has no attribute 'reduce_cython__' Press any key to continue . . .

I did install cython using pip, but I still get the same error. Do you know what could go wrong?

lvapeab commented 5 years ago

Hi,

this seems a problem when using the h5py that is bundled with Anaconda or Tensorflow for Windows (https://github.com/h5py/h5py/issues/1151). I have no access to a Windows machine, so I cannot reproduce the issue. Try downgrading the h5py package or reinstalling it from pip.

KushalDave commented 5 years ago

I tried a lot of things did not work and left it to that. I instead just leverage the TranslationModel class from model_zoo.py in my script. Thanks.