Hi
I have installed and uninstalled for Python, PennyLane, and StraweberryFields these few days just wish to test two examples i.e., pennylane_quantum_neural_net.py and function_fitting.py. The latter always come ut error “TypeError: backend must be a string or a BaseBackend instance.”
I have tried to search advice or solutions but cannot make it done. This half-day I have corrected the 8 *.py codes according to " [WIP] Upgrades the TensorFlow backend to TF2.0 #323" (https://github.com/XanaduAI/strawberryfields/pull/323) but it still come errors too.
Below is my setting for installing strawberryfields, kindly point out if there is any mistake that causing the function_fitting.py not working.
Thank you very much.
Chien
Strawberry Fields: a Python library for continuous-variable quantum circuits.
Copyright 2018-2020 Xanadu Quantum Technologies Inc.
Python version: 3.7.6
Platform info: Windows-10-10.0.16299-SP0
Installation path: C:\Users<user>\AppData\Roaming\Python\Python37\site-packages\strawberryfields
Strawberry Fields version: 0.13.0
Numpy version: 1.18.3
Scipy version: 1.4.1
SymPy version: 1.5
NetworkX version: 2.4
The Walrus version: 0.12.0
Blackbird version: 0.2.4
TensorFlow version: 2.0.0
2020-04-22 15:15:05.654882: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiTraceback (most recent call last):
File “function_fitting.py”, line 121, in
eng, q = sf.Engine(1)
File “C:\Users<user>\AppData\Roaming\Python\Python37\site-packages\strawberryfields\engine.py”, line 328, in init
super().init(backend, backend_options)
File “C:\Users<user>\AppData\Roaming\Python\Python37\site-packages\strawberryfields\engine.py”, line 67, in init
raise TypeError(“backend must be a string or a BaseBackend instance.”)
TypeError: backend must be a string or a BaseBackend instance.