-
Notifications
You must be signed in to change notification settings - Fork 218
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
运行例子报错 #31
Comments
你好,由于最近更新了GAFT的部分接口,mpi的部分在最新版本中不会自动实例化,而是用户自行实例化。例子是我忘记更新了,你可以将你的脚本中的 from gaft.mpiutil import mpi 改写成 from gaft.mpiutil import MPIUtil
mpi = MPIUtil() |
例子我会在今天进行更新,谢谢提醒 |
运行例子还是报错: C:\Users\Administrator\Envs\py3MachineLearning\Scripts\python.exe D:/personal/Mathematical_modeling/genetic_algorithm.py engine.py: import cProfile from .components import IndividualBase, Population mpi = MPIUtil() mpiutile.py def master_only(func):
代码: -- coding: utf-8 --''' from math import sin, cos, pi from gaft import GAEngine Built-in best fitness analysis.from gaft.analysis.fitness_store import FitnessStore Define population.indv_template = BinaryIndividual(ranges=[(-2, 2), (-2, 2)], eps=0.001) Create genetic operators.#selection = RouletteWheelSelection() Create genetic algorithm engine.Here we pass all built-in analysis to engine constructor.engine = GAEngine(population=population, selection=selection, Define fitness function.@engine.fitness_register if 'main' == name: |
Did you install GAFT using Thanks for your issue. |
pip in install 也有問題, 人手條改 C:\ProgramData\Anaconda3\Lib\site-packages\gaft\mpiutil.py 後就無事 |
可以通过pip install 安装 0.5.7版本,bug已修复 |
在win10+py3.5上安装,mpi测试用例正常
![image](https://user-images.githubusercontent.com/32871827/48416476-4641fc00-e78b-11e8-9b85-e1dca0f6ab22.png)
![image](https://user-images.githubusercontent.com/32871827/48416682-d122f680-e78b-11e8-9afa-114abe9f093e.png)
运行例子时,报错:
请问是什么原因?
谢谢!
The text was updated successfully, but these errors were encountered: