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
PicklingError: Can't pickle <function param_shift at 0x000001C66ECB9670>: it's not the same object as pennylane.gradients.parameter_shift.param_shift
#275
Open
anhphuong-ngo opened this issue
Feb 17, 2023
· 2 comments
I am working on QNN model. My algorithm works fine with "default.qubit" device. However, it got issues when I try with 3rd-party device (e.g. qiskit IBMQ and qulacs). I appreciate any help and suggestions.
File "C:\ProgramData\Anaconda3\lib\multiprocessing\process.py", line 121, in start
self._popen = self._Popen(self)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\context.py", line 224, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\context.py", line 327, in _Popen
return Popen(process_obj)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\popen_spawn_win32.py", line 93, in __init__
reduction.dump(process_obj, to_child)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
PicklingError: Can't pickle <function param_shift at 0x000001C66ECB9670>: it's not the same object as pennylane.gradients.parameter_shift.param_shift
WARNING: Ignoring invalid distribution -iskit-terra (c:\programdata\anaconda3\lib\site-packages)
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\ProgramData\Anaconda3\lib\multiprocessing\spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\spawn.py", line 126, in _main
self = reduction.pickle.load(from_parent)
EOFError: Ran out of input
Qulacs
File "C:\Users\ango1\Desktop\Quantum Reinforcement Learning\RL_EV_Experiment04_Pennylane\code\HSA.py", line 327, in <module>
[w.start() for w in workers]
File "C:\Users\ango1\Desktop\Quantum Reinforcement Learning\RL_EV_Experiment04_Pennylane\code\HSA.py", line 327, in <listcomp>
[w.start() for w in workers]
File "C:\ProgramData\Anaconda3\lib\multiprocessing\process.py", line 121, in start
self._popen = self._Popen(self)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\context.py", line 224, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\context.py", line 327, in _Popen
return Popen(process_obj)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\popen_spawn_win32.py", line 93, in __init__
reduction.dump(process_obj, to_child)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
TypeError: cannot pickle 'qulacs_core.QuantumState' object
WARNING: Ignoring invalid distribution -iskit-terra (c:\programdata\anaconda3\lib\site-packages)
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\ProgramData\Anaconda3\lib\multiprocessing\spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\spawn.py", line 126, in _main
self = reduction.pickle.load(from_parent)
EOFError: Ran out of input
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\ProgramData\Anaconda3\lib\multiprocessing\spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "C:\ProgramData\Anaconda3\lib\multiprocessing\spawn.py", line 126, in _main
self = reduction.pickle.load(from_parent)
EOFError: Ran out of input
The text was updated successfully, but these errors were encountered:
Hi @anhphuong-ngo, could you please share the data you're using and the rest of your code? I'm not being able to replicate your error with the information provided.
If you can share a minimal but self-contained version of your code then we can help you better.
Jumping on this conversation, we found a bug that might be related: qiskit-community/qiskit-machine-learning#607. The minor release that will go live later this week will fix the pickle compatibility within Qiskit machine learning, and there's a chance something similar was done in @Qiskit core too to fix similar bugs.
@anhphuong-ngo, have you tried running your code again with the latest plugin releases?
I am working on QNN model. My algorithm works fine with "default.qubit" device. However, it got issues when I try with 3rd-party device (e.g. qiskit IBMQ and qulacs). I appreciate any help and suggestions.
Same code
Errors
IBMQ
Qulacs
The text was updated successfully, but these errors were encountered: