8000 Fix hyperopt pickle by xmatthias · Pull Request #1247 · freqtrade/freqtrade · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix hyperopt pickle #1247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 30, 2018
Merged

Fix hyperopt pickle #1247

merged 4 commits into from
Sep 30, 2018

Conversation

xmatthias
Copy link
Member

Summary

Fix hyperopt to work with new version of scikit-learn

Solve the issue shown after the update of scikit-learn to 0.20.0: #1242
Potentially fixes #1232 - but will need further testing.

Quick changelog

  • Show error if --strategy is used with hyperopt.
    methods from the strategy are not used anyway, so using a custom strategy does not provide gains here - as currently the hyperopt file needs to be modified

The problem comes from hyperopt-processes not properly finding the strategy class - and therefore pickle shows an error on load. This is caused by the fact on how we load strategies.

error:

2018-09-28 12:34:38,933 - freqtrade.optimize.hyperopt - INFO - Found 2 CPU cores. Let's make them scream!
sklearn.externals.joblib.externals.loky.process_executor._RemoteTraceback: 
'''
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/sklearn/externals/joblib/externals/loky/process_executor.py", line 393, in _process_worker
    call_item = call_queue.get(block=True, timeout=timeout)
  File "/opt/python/3.6.3/lib/python3.6/multiprocessing/queues.py", line 113, in get
    return _ForkingPickler.loads(res)
AttributeError: Can't get attribute 'DefaultStrategy' on <module 'freqtrade.strategy' from '/home/travis/build/freqtrade/freqtrade/freqtrade/strategy/__init__.py'>
'''
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "freqtrade/main.py", line 89, in <module>
    main(sys.argv[1:])
  File "freqtrade/main.py", line 35, in main
    args.func(args)
  File "/home/travis/build/freqtrade/freqtrade/freqtrade/optimize/hyperopt.py", line 407, in start
    hyperopt.start()
  File "/home/travis/build/freqtrade/freqtrade/freqtrade/optimize/hyperopt.py", line 368, in start
    f_val = self.run_optimizer_parallel(parallel, asked)
  File "/home/travis/build/freqtrade/freqtrade/freqtrade/optimize/hyperopt.py", line 332, in run_optimizer_parallel
    return parallel(delayed(self.generate_optimizer)(v) for v in asked)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/sklearn/externals/joblib/parallel.py", line 996, in __call__
    self.retrieve()
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/sklearn/externals/joblib/parallel.py", line 899, in retrieve
    self._output.extend(job.get(timeout=self.timeout))
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/sklearn/externals/joblib/_parallel_backends.py", line 517, in wrap_future_result
    return future.result(timeout=timeout)
  File "/opt/python/3.6.3/lib/python3.6/concurrent/futures/_base.py", line 432, in result
    return self.__get_result()
  File "/opt/python/3.6.3/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
sklearn.externals.joblib.externals.loky.process_executor.BrokenProcessPool: A task has failed to un-serialize. Please ensure that the arguments of the function are all picklable.

@coveralls
Copy link
coveralls commented Sep 29, 2018

Coverage Status

Coverage increased (+0.003%) to 98.34% when pulling 84622dc on fix_hyperopt_pickle into 448f3a7 on develop.

@xmatthias xmatthias merged commit 3af3094 into develop Sep 30, 2018
@xmatthias xmatthias deleted the fix_hyperopt_pickle branch September 30, 2018 14:51
This was referenced Oct 8, 2018
@xmatthias xmatthias added the Hyperopt Hyperopt related issues and pull requests label Oct 12, 2018
@coveralls
Copy link

Coverage Status

coverage: 94.423% (-3.9%) from 98.336%
when pulling 84622dc on fix_hyperopt_pickle
into 448f3a7 on develop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hyperopt Hyperopt related issues and pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hyperopt error Windows
3 participants
0