quantum icon indicating copy to clipboard operation
quantum copied to clipboard

The version of tensorflow and protobuf.

Open XxX2009 opened this issue 3 years ago • 6 comments

Firstly, I installed tensorflow==2.4.1 with pip install tensorflow==2.4.1. It's ok. then I installed tensorflow-quantum with pip install -q tensorflow-quantum. There was an error following the figure: error1 So, I uninstalled protobuf==3.8.0 and installed protobuf==3.9.2, but there was still an error following the figure: error2 I am really confused now, please help me getting rid of this.

XxX2009 avatar Feb 16 '22 09:02 XxX2009

There appears to be a number of version mismatches. The latest version of tensorflow quantum requires tensorflow==2.7.0 and cirq >= 0.13.1. So TF 2.4.1 and cirq 0.8 will cause problems. TFQ 0.5.1 is compatible with TF 2.4.1 but requires cirq==0.11.0. I believe cirq 0.8.0 is compatible with TFQ 0.3.1 which works with TF 2.1.0. If you want the latest version of TFQ, just make a new environment and follow the install instructions https://www.tensorflow.org/quantum/install.

lockwo avatar Feb 16 '22 16:02 lockwo

Thank you for your help. But I am sorry to tell you that I've got new problem. FIrstly, I created an environment with python 3.8 and tried to install the latest version of TFQ. As your advice, I needed TF 2.7.0 and cirq >= 0.13.1. After installing TF 2.7.0 and cirq == 0.13.1, I installed TFQ with pip install -U tensorflow-quantum, but it showed the following figure: error3 Then, I created another environment with python 3.6.2 and installed TF 2.1.0 and TFQ 0.3.1. It works. However, when I run the code of noise_suppression.ipynb. There was an error following the figure: error4 As your answer at https://github.com/tensorflow/quantum/issues/670#issuecomment-1039894771, I tried to fix the problem with pip install -U tensorflow-quantum. But it did not work. Finally, thank you for your patience.

There appears to be a number of version mismatches. The latest version of tensorflow quantum requires tensorflow==2.7.0 and cirq >= 0.13.1. So TF 2.4.1 and cirq 0.8 will cause problems. TFQ 0.5.1 is compatible with TF 2.4.1 but requires cirq==0.11.0. I believe cirq 0.8.0 is compatible with TFQ 0.3.1 which works with TF 2.1.0. If you want the latest version of TFQ, just make a new environment and follow the install instructions https://www.tensorflow.org/quantum/install.

XxX2009 avatar Feb 17 '22 07:02 XxX2009

The tutorial won't work with 0.3.1 because noise support was added in 0.5. As for the first error, are you by any chance using windows?

lockwo avatar Feb 17 '22 13:02 lockwo

The tutorial won't work with 0.3.1 because noise support was added in 0.5. As for the first error, are you by any chance using windows? I am using windows 10. And could you tell me what should I do?

XxX2009 avatar Feb 18 '22 08:02 XxX2009

TFQ 0.3 is the latest version supported on windows (hence why you cannot update it on windows using pip -U). When I am working on my laptop with windows, I use WSL to work with current TFQ versions. Google colab is also a good option.

lockwo avatar Feb 18 '22 15:02 lockwo

Thanks for clearing this up @lockwo ! To confirm we do not currently support windows in our latest releases and in order to upgrade to the latest version, one does need to use a mac or linux platform.

MichaelBroughton avatar Feb 24 '22 19:02 MichaelBroughton