Tensorflow 2.5.0 and Gensim 4.0.1 compatibility with numpy

Viewed 1538

I have a compatibility issue when running : pip install numpy==1.19.4 pip install tensorflow=2.5.0 pip install gensim==4.0.1

On Ubuntu 18.04, with Python 3.9.5 (installs made inside docker container).

I get the following exception when trying to import gensim: ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject. Not sure how i can make this work, I tried downgrading several libraries but still not achieved to make it work in Ubuntu.

Edit : it works on Python 3.8.10

2 Answers

It is the numpy version , downgrade numpy to 1.19.2 or lower and see.

Tensorflow is currently not compatible with numpy 1.20. Also, many changes happened from gensim 3.X to 4.X, which may lead to some problems.

Try installing the following setup:

  • numpy 1.19.2
  • gensim 3.8.3
  • tensorflow 2.3.0
Related