Comments (5)
anyone?
from leanparameteroptimization.
Unfortunately the python runtime does not expose much useful information. It is possible to recover more for debugging if compiled from source. I have seen this error when the build is setup differently than as stated in the readme, so perhaps check your x86/x64 target flag. It might also help to do a clean before building.
You may also get this error if trying to run a Python algorithm multi threaded or with the wrong runner, however the optimizer code should prevent this. Can you supply the optimization.config you used for the python algorithm?
There is a Python algorithm integration test, so it may be interesting if you can run this.
Beyond these checks it will help if you can describe your system OS, .net framework or mono version and any other relevant details as well as supplying the log.txt and error.txt.
from leanparameteroptimization.
I am facing the same issue wherein the Python version gets stuck at PythonEngine.Initialize():
- Building on x86
- Windows 10
- Visual Studio 2019
- Python 3.6.8
Getting no error on VB output but following warning:
Following is the code for optimization.json:
{ "genes": [ { "key": "take", "min": 0.02, "max": 0.1, "precision": 2, "actual": 0.06 }, { "key": "fast", "min": 6, "max": 48, "precision": 0, "actual": 44 }, { "key": "slow", "min": 48, "max": 500, "actual": 63 } ], "populationSize": 24, "populationSizeMaximum": 48, "generations": 20, "stagnationGenerations": 30, "maxThreads": 1, "configPath": "../../../../Lean/Launcher/config.json", //"configPath": "C:/Users/Abhishek/source/repos/Lean/Launcher/config.json", "algorithmTypeName": "ParameterizedSharedAppDomainAlgorithm", //"algorithmLocation": "Jtc.Optimization.LeanOptimizer.Example.dll", "algorithmLocation": "../../../Jtc.Optimization.LeanOptimizer.Example/ParameterizedSharedAppDomainAlgorithm.py", //"algorithmLanguage": "CSharp", "algorithmLanguage": "Python", "includeNegativeReturn": true, "onePointCrossover": true, "fitnessTypeName": "Jtc.Optimization.LeanOptimizer.OptimizerFitness", //"fitnessTypeName": "Jtc.Optimization.LeanOptimizer.ConfiguredFitness", //"fitnessTypeName": "Jtc.Optimization.LeanOptimizer.NFoldCrossReturnMaximizer", //"fitnessTypeName": "Jtc.Optimization.LeanOptimizer.NFoldCrossSharpeMaximizer", //"fitnessTypeName": "Jtc.Optimization.LeanOptimizer.SharpeMaximizer", "useSharedAppDomain": false, "enableRunningDuplicateParameters": false, "dataFolder": "../../../../Lean/Data", "minimumTrades": 1, "enableFitnessFilter": true //"startDate": "2013-10-08T00:00:00Z", //"endDate": "2013-10-10T00:00:00Z", //"mutationProbability": 0.5, //"crossoverProbability": 0.75 //"fitness": { // "folds": 2, // "scale": 1, // "modifier": -1, // "resultKey": "Beta", // "name": "MinimizeBeta", // "OptimizerTypeName": "ParticleSwarm" // "OptimizerTypeName": "RandomSearch" // "OptimizerTypeName": "GlobalizedBoundedNelderMead" //} }
Windows
from leanparameteroptimization.
Hi,
Has there been any progress with this. I haven't really managed to get anything to work. The previous version had issues with dll, and was hoping the latest release will work with python.
Thanks.
from leanparameteroptimization.
I got everything launching except the final issue - parameterized setup.
в QuantConnect.Lean.Engine.Setup.ConsoleSetupHandler.CreateAlgorithmInstance(AlgorithmNodePacket algorithmNodePacket, String assemblyPath) в Z:\Users\seven\projects\algotrading\quantconnect\Lean\Engine\Setup\ConsoleSetupHandler.cs:строка 105 в QuantConnect.Lean.Engine.Engine.Run(AlgorithmNodePacket job, AlgorithmManager manager, String assemblyPath, WorkerThread workerThread) в Z:\Users\seven\projects\algotrading\quantconnect\Lean\Engine\Engine.cs:строка 117:QuantConnect.Lean.Engine.Setup.AlgorithmSetupException: During the algorithm initialization, the following exception has occurred: Loader.TryCreatePythonAlgorithm(): Unable to import python module ../../../Jtc.Optimization.LeanOptimizer.Example/ParameterizedSharedAppDomainAlgorithm.py. AlgorithmPythonWrapper(): ModuleNotFoundError : No module named 'Jtc' at <module> in ParameterizedSharedAppDomainAlgorithm.py:line 26 :: from Jtc.Optimization.LeanOptimizer.Example import InstancedConfig ModuleNotFoundError : No module named 'Jtc' в QuantConnect.Lean.Engine.Setup.ConsoleSetupHandler.CreateAlgorithmInstance(AlgorithmNodePacket algorithmNodePacket, String assemblyPath) в Z:\Users\seven\projects\algotrading\quantconnect\Lean\Engine\Setup\ConsoleSetupHandler.cs:строка 105
My config file
{ "genes": [ { "key": "take", "min": 0.02, "max": 0.1, "precision": 2, "actual": 0.06 }, { "key": "fast", "min": 6, "max": 48, "precision": 0, "actual": 44 }, { "key": "slow", "min": 48, "max": 500, "actual": 63 } ], "populationSize": 24, "populationSizeMaximum": 48, "generations": 20, "stagnationGenerations": 30, "maxThreads": 8, "configPath": "../../../../Lean/Launcher/config.json", //"algorithmTypeName": "ParameterizedAlgorithm", "algorithmTypeName": "ParameterizedSharedAppDomainAlgorithm", //"algorithmLocation": "Jtc.Optimization.LeanOptimizer.Example.dll", "algorithmLocation": "../../../Jtc.Optimization.LeanOptimizer.Example/ParameterizedSharedAppDomainAlgorithm.py", //"algorithmLanguage": "CSharp", "algorithmLanguage": "Python", "includeNegativeReturn": true, "debugging": true, "onePointCrossover": true, "fitnessTypeName": "Jtc.Optimization.LeanOptimizer.OptimizerFitness", //"fitnessTypeName": "Jtc.Optimization.LeanOptimizer.ConfiguredFitness", //"fitnessTypeName": "Jtc.Optimization.LeanOptimizer.NFoldCrossReturnMaximizer", //"fitnessTypeName": "Jtc.Optimization.LeanOptimizer.NFoldCrossSharpeMaximizer", //"fitnessTypeName": "Jtc.Optimization.LeanOptimizer.SharpeMaximizer", "useSharedAppDomain": false, "enableRunningDuplicateParameters": false, "dataFolder": "../../../../Lean/Data", "minimumTrades": 1, "enableFitnessFilter": true //"startDate": "2013-10-08T00:00:00Z", //"endDate": "2013-10-10T00:00:00Z", //"mutationProbability": 0.5, //"crossoverProbability": 0.75 //"fitness": { // "folds": 2, // "scale": 1, // "modifier": -1, // "resultKey": "Beta", // "name": "MinimizeBeta", // "OptimizerTypeName": "ParticleSwarm" // "OptimizerTypeName": "RandomSearch" // "OptimizerTypeName": "GlobalizedBoundedNelderMead" //} }
The must-have fix that I implemented is to fix multi-thread access.
Delete engine.Run(job, algorithmManager, algorithmPath, workerThread);
Add engine.Run(job, algorithmManager, algorithmPath, WorkerThread.Instance);
Also, you need to go to Rapid Environment Editor and make sure there are no invalid paths (displayed in red), if there are some - remove them.
And the last moment - make sure cmd.exe "py" shows Python 3.6.8, not Python 3.7 or other versions.
from leanparameteroptimization.
Related Issues (14)
- How to run the python example
- Newbie question - MacOS HOT 2
- Quantconnect missing references HOT 1
- Ideas HOT 1
- Thanks HOT 7
- Features on the Blazer App not working HOT 3
- Reference QuantConnect.Engine nuget instead of local Lean clone HOT 1
- Ci build
- SharpLearning.Containers.Extensions Build Error HOT 1
- BacktestingResultHandler class does not have a Run method to invoke HOT 1
- Failed to complete setup of assembly (hr = 0x8007000b) HOT 2
- Unable to run rJtc.Optimization.Launcher.Legacy HOT 9
- Unable to run the optimizer HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from leanparameteroptimization.