1

When I tried to use Flair taggers in combination with Universal Sentence Encoder(USE) for embedding everything worked well on CPU and GPU produced error:

self._session = tf_session.TF_NewSessionRef(self._graph.c_graph, opts)
tensorflow.python.framework.errors_impl.InternalError: cudaGetDevice() failed. Status: CUDA driver version is insufficient for CUDA runtime version

I knew that CUDA, CUDA runtime, cuDNN are correct because I checked with documantion. I used Docker so I am sure about their versions versions. TF.Session was set to allow gpu growth.

Strangely using only Flair worked and using only TensorFlow (without Flair imported) worked well. Problems appeared with versions:

torch==1.3.1
tensorflow-gpu==1.14.0
tensorflow-hub==0.7.0
numpy==1.17.1
flair==0.4.4
Tomasz Kot
  • 66
  • 5

1 Answers1

0

The problem appeared to be only when Flair library was imported before TF and it was blocking its tries to use GPU.

Recently they fixed their mistake. So if it is possible I recommend to use Flair version 0.4.5 or newer.

If for some reason you still need to use Flair version 0.4.4 I found this to work well: Always import tensorflow before importing Flair (even if you don't use it in current file).

That version also had problems with Pillow and torchvision packages. I recommend installing them in versions: Pillow==6.2.1 and torchvision==0.4.2. Hope it would be usefull. If any post like this existed before it would save me couple of days debugging.

Tomasz Kot
  • 66
  • 5