I installed & ran the conversion as directed in the quick start section
pip install --upgrade pip
pip install ctranslate2
pip install OpenNMT-py
I get this error:
Traceback (most recent call last):
File “/home/hihoan/.local/bin/ct2-opennmt-py-converter”, line 8, in
sys.exit(main())
File “/home/hihoan/.local/lib/python3.8/site-packages/ctranslate2/bin/opennmt_py_converter.py”, line 13, in main
converters.OpenNMTPyConverter(args.model_path).convert_from_args(args)
File “/home/hihoan/.local/lib/python3.8/site-packages/ctranslate2/converters/converter.py”, line 31, in convert_from_args
return self.convert(
File “/home/hihoan/.local/lib/python3.8/site-packages/ctranslate2/converters/converter.py”, line 45, in convert
model_spec = self._load()
File “/home/hihoan/.local/lib/python3.8/site-packages/ctranslate2/converters/opennmt_py.py”, line 60, in _load
checkpoint = torch.load(self._model_path, map_location=“cpu”)
File “/usr/local/lib/python3.8/dist-packages/torch/serialization.py”, line 584, in load
return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
File “/usr/local/lib/python3.8/dist-packages/torch/serialization.py”, line 842, in _load
result = unpickler.load()
ModuleNotFoundError: No module named ‘onmt’
Just wondering what OS, python version this was tested on and how I can fix the issue? Mine is Ubuntu 20.04, python 3.8.5
This and other issues FYI. None of these are showstoppers for me but if you want more info just howl:
I think I was mixing my conda & python env. Straightened it out and made sure those things are installed and it works as expected.
OpenNMT-py 2.1.2
OpenNMT-tf 2.19.0
The ct2 converter needed the following args to run, (line 74 & 88 in the README.md):
–model_spec TransformerBase
there is a link error when compiling ctranslate2
/usr/bin/ld: …/libctranslate2.so: undefined reference to `cblas_sgemm_batch_strided’
My mkl is installed via apt install
# apt list | grep mkl
intel-mkl-cluster/focal 2020.0.166-1 amd64
intel-mkl-doc/focal,now 2020.0.166-1 all [installed,automatic].....
cmake isn’t successful on my WIndows/WSL laptop (Ubuntu 20.04), either using either
This argument was removed recently, in the latest major version. Make sure you have the latest source or package.
This function was added in Intel MKL 2020.2 but we check for that in the code:
Do you have multiple versions of Intel MKL installed on your system? I just installed the package intel-mkl-64bit-2020.0-088 in a fresh Ubuntu 20.04 Docker container and compilation works fine.
righto. I have the following latest versions installed. Will remember when it gets updated
OpenNMT-py 2.1.2
OpenNMT-tf 2.19.0
ah yes, there’s a older mkl installed in /opt. However, on Linux or WSL where it isn’t installed, then a cmake error. I remember mkl ask whether to install it as the default blas. I said yes and I can’t seem to be able to change it. Guess this is the reason why cmake can’t see it. Output below:
cmake -DWITH_MKL=ON …
– The C compiler identification is GNU 9.3.0
– The CXX compiler identification is GNU 9.3.0
– Check for working C compiler: /usr/bin/cc
– Check for working C compiler: /usr/bin/cc – works
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Detecting C compile features
– Detecting C compile features - done
– Check for working CXX compiler: /usr/bin/c++
– Check for working CXX compiler: /usr/bin/c++ – works
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Detecting CXX compile features
– Detecting CXX compile features - done
– Looking for pthread.h
– Looking for pthread.h - found
– Performing Test CMAKE_HAVE_LIBC_PTHREAD
– Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
– Looking for pthread_create in pthreads
– Looking for pthread_create in pthreads - not found
– Looking for pthread_create in pthread
– Looking for pthread_create in pthread - found
– Found Threads: TRUE
– Looking for dlfcn.h
– Looking for dlfcn.h - found
– Looking for getauxval
– Looking for getauxval - found
– Compiling for multiple CPU ISA and enabling runtime dispatch
– Found OpenMP_C: -fopenmp (found version “4.5”)
– Found OpenMP_CXX: -fopenmp (found version “4.5”)
– Found OpenMP: TRUE (found version “4.5”)
– Using OpenMP: /usr/lib/x86_64-linux-gnu/libiomp5.so
CMake Error at CMakeLists.txt:229 (message):
MKL include directory not found
– Configuring incomplete, errors occurred!
See also “/mnt/c/Users/hihoan/workspace/github/CTranslate2/build/CMakeFiles/CMakeOutput.log”.
See also “/mnt/c/Users/hihoan/workspace/github/CTranslate2/build/CMakeFiles/CMakeError.log”.