Skip to content
All library documents

A Multiprocessing Pickling Error in Genetic Backtest Optimization

Article vn.py community

Summary

This forum post reports a failure during VeighNa’s genetic-algorithm optimization for a strategy backtest. The traceback reaches Python’s multiprocessing pool while it tries to send evaluation work to worker processes. Serialization then fails because the strategy’s parameter class cannot be pickled: Python says the class object is not the same object as the class at its expected module path.

The report identifies where the failure occurs but gives no diagnosis or fix, so it is a troubleshooting clue rather than a complete solution. The error points toward a mismatch in class identity during serialization, which can arise when a class is redefined, reloaded, or imported through conflicting module references; the post itself does not establish which cause applies. It offers no information about strategy logic, trading performance, or optimization quality. Resolving it would require checking how the strategy class is defined and imported and whether worker processes can import the same class from a stable module path.

Key ideas

  • The error occurs when genetic optimization sends evaluation work through Python multiprocessing.
  • The traceback ends with a pickling failure for a strategy parameter class.
  • Python reports that the class object differs from the object at its declared module path.
  • The post contains no confirmed root cause, fix, or evidence about the strategy’s trading behavior.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.