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
QNG has been recently added to qinfo_tools. While it works smoothly with simple training loops, as shown here, it is not compatible with train(), function defined in qadence to automate the definition of the training process with gradient-based optimizers.
In particular, the error seems to be related to Python's pickle module having trouble pickling a local object:
Traceback (most recent call last):
File ".../qadence/ml_tools/saveload.py", line 76, in write_checkpoint
torch.save(
File ".../torch/serialization.py", line 628, in save
_save(obj, opened_zipfile, pickle_module, pickle_protocol, _disable_byteorder_record)
File ".../torch/serialization.py", line 840, in _save
pickler.dump(obj)
AttributeError: Can't pickle local object 'Parametric.__init__.<locals>.parse_values'
The text was updated successfully, but these errors were encountered:
Thanks for finding this @DanieleCucurachi. As discussed, I believe the issue is in the serialization of the optimizer's state_dict, as the QNG's state_dict holds a quantum circuit. We probably need to add some logic to correctly serialize it. I will take a look into it
Description
QNG has been recently added to
qinfo_tools
. While it works smoothly with simple training loops, as shown here, it is not compatible withtrain()
, function defined inqadence
to automate the definition of the training process with gradient-based optimizers.In particular, the error seems to be related to Python's pickle module having trouble pickling a local object:
The text was updated successfully, but these errors were encountered: