Skip to content

Problem in example code possibly due to newer version of tensorflow #247

@qc-man

Description

@qc-man

Describe the bug

While running the example code as provided in the docs for two qubit chip with C3, an error message appears. Error message is: AttributeError: module 'tensorflow.python.framework.ops' has no attribute 'Tensor'

To Reproduce

Create a fresh env with pip install c3-toolset (which will be a standard step for anyone starting with the package. It also requires pip install tf-keras ). Then run the example code (link: https://c3-toolset.readthedocs.io/en/master/two_qubits.html), the code where we define the Quantities does not work and gives the attribute error as mentioned above.

Expected behavior

A clear and concise description of what you expect(ed) to happen.

Screenshots

image
image
these two screenshots are there just visually showing the issue that I have briefly described above

Environment (please complete the following information)

  • OS: Windows
  • Python Version: Python 3.12.3
  • c3-toolset Version 1.4
  • Other 'might be important' packages version details:
  • tensorboard 2.16.2
    -tensorboard-data-server 0.7.2
    -tensorflow 2.16.1
    -tensorflow-estimator 2.15.0
    -tensorflow-intel 2.16.1
    -tensorflow-probability 0.24.0
    -termcolor 2.4.0
    -terminado 0.18.1
    -tf_keras 2.16.0

Additional context

A simple hack to get over this problem would have been to have an older version of TensorFlow installed but unfortunately, I am unable to install the older versions of TensorFlow.

On the other hand, the requirement for C3-toolset has TensorFlow version greater than 2.15.0 but greater than 2.15 versions do not seem to work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions