Tensorflow-quantum refuses to even import

Hello! I’m new to Tensorflow and tried recently to use it for quantum machine learning. I used tensorflow-quantum for it, but the problem started just after installation. After I pip installed it and tried to write “import tensorflow_quantum” it gave me this response: “/usr/local/lib/python3.10/dist-packages/tensorflow_quantum/core/ops/_tfq_simulate_ops.so: undefined symbol: _ZN10tensorflow15OpKernelContext10CtxFailureEPKciRKN4absl12lts_202301256StatusE”
I tried several versions (didn’t have this issue only on 0.4.0, but it is too old) and several devices (my own computer (Ubuntu 20.04), Collab etc), the result is the same. No conflicting dependencies, no warnings except this. Have you encountered it (for every version above 0.4.0)? I can’t imagine that a full library can be broken to such extent that it doesn’t even import, so tell me please what I could do wrong

1 Like

Hi @Dmitry_Zhiganov, By default colab comes with tensorflow 2.17 which is not compatible with tensorflow quantum. If you install tensorflow 2.15 in colab then you can able to import tensorflow_quantum 0.7.2 without any error. please refer to this gist. Thank You.

2 Likes