Giter VIP home page Giter VIP logo

Comments (5)

anaderi avatar anaderi commented on May 26, 2024

anyone?

from leanparameteroptimization.

jameschch avatar jameschch commented on May 26, 2024

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.

AmazingAbhi avatar AmazingAbhi commented on May 26, 2024

I am facing the same issue wherein the Python version gets stuck at PythonEngine.Initialize():

  1. Building on x86
  2. Windows 10
  3. Visual Studio 2019
  4. Python 3.6.8

Getting no error on VB output but following warning:

image

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.

dakr001 avatar dakr001 commented on May 26, 2024

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.

iSevenDays avatar iSevenDays commented on May 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.