Skip to content
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

demo_pso_tsp.py运行有误 #231

Open
a2635814919 opened this issue Sep 25, 2024 · 1 comment
Open

demo_pso_tsp.py运行有误 #231

a2635814919 opened this issue Sep 25, 2024 · 1 comment

Comments

@a2635814919
Copy link

a2635814919 commented Sep 25, 2024

报错信息为:
invalid escape sequence '\h'

Traceback (most recent call last):
File "D:\Programs\OA\scikit-opt\examples\demo_pso_tsp.py", line 25, in
pso_tsp = PSO_TSP(func=cal_total_distance, n_dim=num_points, size_pop=200, max_iter=800, w=0.8, c1=0.1, c2=0.1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Programs\OA\scikit-opt\sko\PSO.py", line 212, in init
self.func = func_transformer(func)
^^^^^^^^^^^^^^^^^^^^^^
TypeError: func_transformer() missing 1 required positional argument: 'n_processes'

@a2635814919
Copy link
Author

经检查为PSO.py中PSO_TSP类__init__函数中(212行)未对n_processes做初始化,修改为n_processes=0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant