PaddlePaddle / Quantum

Other
567 stars 176 forks source link

Many of the examples dont work #42

Closed BoltzmannEntropy closed 1 year ago

BoltzmannEntropy commented 1 year ago

For instance: QGAN_EN.iynb

RuntimeError: (NotFound) There are no kernels which are registered in the einsum operator.
  [Hint: Expected kernels_iter != all_op_kernels.end(), but received kernels_iter == all_op_kernels.end().] (at /paddle/paddle/fluid/imperative/prepared_operator.cc:341)
  [operator < einsum > error]
image

QAutoencoder_CN.ipynb:

ValueError: (InvalidArgument) conj(): argument 'X' (position 0) must be Tensor, but got numpy.ndarray (at /paddle/paddle/fluid/pybind/op_function_common.cc:737)

image

Can you help?

LeiZhang-116-4 commented 1 year ago

Hello. I think you may need to check your Paddle Quantum version. All linear algbrea related functions, including the dagger function, are compatible with numpy.ndarray since version 2.2.2 of the Paddle Quantum.

BoltzmannEntropy commented 1 year ago

I am on a machine without AVX (rror: Your machine doesn't support AVX, but the installed PaddlePaddle is avx core, you should reinstall paddlepaddle with no-avx core.), so this is what I had to do:

RUN python3.8 -m pip download paddlepaddle==2.3.2 -f https://www.paddlepaddle.org.cn/whl/linux/mkl/noavx/stable.html --no-index --no-deps
# does not work well RUN python3.8 -m pip install paddlepaddle==2.4.1 -i https://pypi.tuna.tsinghua.edu.cn/simple paddle-quantum
RUN python3.8 -m pip install paddlepaddle-2.3.2-cp38-cp38-linux_x86_64.whl paddle-quantum
Python 3.8.10 | packaged by conda-forge | (default, May 11 2021, 07:01:05) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import paddle
>>> import paddle_quantum
>>> paddle_quantum.__version__
'2.2.0'

`ERROR: Cannot install paddle-quantum==2.2.2 and paddlepaddle 2.3.2 (from /paddlepaddle-2.3.2-cp38-cp38-linux_x86_64.whl) because these package versions have conflicting dependencies.
`

Any other option?

LeiZhang-116-4 commented 1 year ago

Well I am not familiar with AVX. But a possible temporary solution is to run the old tutorials supported by the version 2.2.0 of Paddle Quantum.

But I still recommend you to upgrade Paddle Quantum to the newest version for better user experiences (if you can find other ways to solve the installation problem).

BoltzmannEntropy commented 1 year ago

Since paddle-quantum is dependent on paddle, and the latest paddle version for no-avx is 2.3.2, I can not install 2.2.2. I really want the newest version, but this is an Ubuntu based docker running inside OSX with the M1 chip. See here: https://github.com/BoltzmannEntropy/QMLDocker

LeiZhang-116-4 commented 1 year ago

Is it possible to downgrade your PaddlePaddle version to 2.3.0 and then upgrade Paddle Quantum?

BoltzmannEntropy commented 1 year ago

Splendid, it works, thank you so much. I updated the docker file.