You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/Users/xxx/Projects/iu/qaml-qiskit/qcnn.py", line 246, in <module>
classifier.save("qcnn.classifier")
File "/Users/xxx/Projects/iu/qaml-qiskit/venv/lib/python3.11/site-packages/qiskit_machine_learning/algorithms/serializable_model.py", line 36, in save
dill.dump(self, handler)
File "/Users/xxx/Projects/iu/qaml-qiskit/venv/lib/python3.11/site-packages/dill/_dill.py", line 336, in dump
Pickler(file, protocol, **_kwds).dump(obj)
File "/Users/xxx/Projects/iu/qaml-qiskit/venv/lib/python3.11/site-packages/dill/_dill.py", line 620, in dump
StockPickler.dump(self, obj)
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/pickle.py", line 487, in dump
self.save(obj)
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/pickle.py", line 603, in save
self.save_reduce(obj=obj, *rv)
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/pickle.py", line 717, in save_reduce
save(state)
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
^^^^^^^^^^^^
File "/Users/xxx/Projects/iu/qaml-qiskit/venv/lib/python3.11/site-packages/dill/_dill.py", line 1251, in save_module_dict
StockPickler.save_dict(pickler, obj)
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/pickle.py", line 972, in save_dict
self._batch_setitems(obj.items())
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/pickle.py", line 998, in _batch_setitems
save(v)
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
^^^^^^^^^^^^
File "/Users/xxx/Projects/iu/qaml-qiskit/venv/lib/python3.11/site-packages/dill/_dill.py", line 1963, in save_function
_save_with_postproc(pickler, (_create_function, (
File "/Users/xxx/Projects/iu/qaml-qiskit/venv/lib/python3.11/site-packages/dill/_dill.py", line 1140, in _save_with_postproc
pickler.save_reduce(*reduction, obj=obj)
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/pickle.py", line 692, in save_reduce
save(args)
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
^^^^^^^^^^^^
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/pickle.py", line 902, in save_tuple
save(element)
File "/usr/local/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/pickle.py", line 560, in save
f(self, obj) # Call unbound method with explicit self
^^^^^^^^^^^^
File "/Users/xxx/Projects/iu/qaml-qiskit/venv/lib/python3.11/site-packages/dill/_dill.py", line 1187, in save_code
obj.co_firstlineno, obj.co_lnotab, obj.co_endlinetable,
^^^^^^^^^^^^^^^^^^^
AttributeError: 'code' object has no attribute 'co_endlinetable'. Did you mean: 'co_linetable'?
Process finished with exit code 1
What version of dill are you using. I believe that was a 3.11 issue in dill that was corrected in their 0.3.6 release.
Note that Qiskit ML does not yet officially support 3.11 #512
I will also note dill was pinned here earlier #498 so installing 0.3.6 would conflict with that in your installation. Can you use an earlier Python e.g. 3.10?
Environment
What is happening?
When I run the 11_quantum_convolutional_neural_networks.ipynb to learn, I want to save the classifier model, and I run the following code.
However, it will produce following error logs.
How can we reproduce the issue?
Run the code in 11_quantum_convolutional_neural_networks.ipynb](https://github.com/Qiskit/qiskit-machine-learning/blob/main/docs/tutorials/11_quantum_convolutional_neural_networks.ipynb), and try to save the model using following code.
What should happen?
The classifier should be saved into a file.
Any suggestions?
No response
The text was updated successfully, but these errors were encountered: