MetaGPT icon indicating copy to clipboard operation
MetaGPT copied to clipboard

Aflow 运行报错

Open qjs2000 opened this issue 10 months ago • 7 comments

运行Aflow 命令,只运行完成round1的执行。然后就都报错,是否不支持qwen 和 deepseek模型来实现?

命令:

python -m examples.aflow.optimize --dataset MATH --opt_model_name deepseek-v3 --exec_model_name qwen2.5 --if_first_optimize=false

模型配置:

models: "qwen2.5": api_type: "dashscope" model: "qwen2.5-72b-instruct" base_url: "https://dashscope.aliyuncs.com/compatible-mode/v1" api_key: "sk-xxxx" temperature: 0.5 "deepseek-v3": api_type: "dashscope" model: "deepseek-v3" base_url: "https://dashscope.aliyuncs.com/compatible-mode/v1" api_key: "sk-xxxx" temperature: 0.5

报错信息:

Bug description

2025-02-20 16:25:18.965 | INFO | metagpt.ext.aflow.scripts.optimizer:optimize:93 - Error occurred: Unable to serialize unknown type: <class 'numpy.int64'>. Retrying... (Attempt 1/1) 2025-02-20 16:25:18.968 | INFO | metagpt.ext.aflow.scripts.optimizer:optimize:95 - Max retries reached. Moving to next round. 2025-02-20 16:25:23.971 | INFO | metagpt.ext.aflow.scripts.optimizer:optimize:106 - Score for round 2: None Traceback (most recent call last): File "", line 198, in run_module_as_main File "", line 88, in run_code File "C:\work\spaces\MetaGPT\examples\aflow\optimize.py", line 133, in optimizer.optimize("Graph") File "C:\work\spaces\MetaGPT\metagpt\ext\aflow\scripts\optimizer.py", line 108, in optimize converged, convergence_round, final_round = self.convergence_utils.check_convergence(top_k=3) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\work\spaces\MetaGPT\metagpt\ext\aflow\scripts\optimizer_utils\convergence_utils.py", line 74, in check_convergence self.avg_scores, self.stds = self.calculate_avg_and_std() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\work\spaces\MetaGPT\metagpt\ext\aflow\scripts\optimizer_utils\convergence_utils.py", line 58, in calculate_avg_and_std self.rounds = self.process_rounds() ^^^^^^^^^^^^^^^^^^^^^ File "C:\work\spaces\MetaGPT\metagpt\ext\aflow\scripts\optimizer_utils\convergence_utils.py", line 44, in process_rounds self.data = self.load_data(root_path=self.root_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\work\spaces\MetaGPT\metagpt\ext\aflow\scripts\optimizer_utils\convergence_utils.py", line 38, in load_data return json.load(file) ^^^^^^^^^^^^^^^ File "C:\Users\ThinkPad.conda\envs\metagpt\Lib\json_init.py", line 293, in load return loads(fp.read(), ^^^^^^^^^^^^^^^^ File "C:\Users\ThinkPad.conda\envs\metagpt\Lib\json_init.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ThinkPad.conda\envs\metagpt\Lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ThinkPad.conda\envs\metagpt\Lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 6 column 23 (char 112)

qjs2000 avatar Feb 20 '25 10:02 qjs2000

Did you solve it?

Clairegggg avatar Mar 10 '25 13:03 Clairegggg

请问一下用的是哪个版本的metagpt,用Version: 0.8.1似乎于aflow代码不太兼容, 2025-03-14 15:51:04.570 | INFO | metagpt.ext.aflow.benchmark.gsm8k:evaluate_problem:53 - Maximum retries reached. Skipping this sample. Error: ActionNode.fill() got an unexpected keyword argument 'context', 最新版本的metagpt,ActionNode.fill()变成了req,将aflow中的context改为req,但还是报错 2025-03-17 16:08:22.409 | INFO | metagpt.ext.aflow.benchmark.gsm8k:evaluate_problem:56 - Maximum retries reached. Skipping this sample. Error: ActionNode.fill() missing 1 required keyword-only argument: 'req'

Guo-Jintao avatar Mar 17 '25 08:03 Guo-Jintao

问题+1

helloword1 avatar Mar 17 '25 08:03 helloword1

解决了,将action_node换成这个链接的就行了https://github.com/geekan/MetaGPT/pull/1510/files?short_path=66cde96

Guo-Jintao avatar Mar 18 '25 02:03 Guo-Jintao

坏了,遇到一楼老哥的错误了,@qjs2000 哥,问题解决了吗

Guo-Jintao avatar Mar 18 '25 03:03 Guo-Jintao

Hi, we will update a easier to use version of AFLOW in https://github.com/FoundationAgents/AFlow. The time maybe Bejing Time 3.19 20:00 @helloword1 @qjs2000 @Guo-Jintao @Clairegggg

didiforgithub avatar Mar 18 '25 07:03 didiforgithub

Hello, are you ok?@didiforgithub

Guo-Jintao avatar Mar 25 '25 02:03 Guo-Jintao

Hello, you can use the code in https://github.com/FoundationAgents/AFlow. @stellaHSR you can close this issue, i think they have used the code in new link.

didiforgithub avatar May 18 '25 10:05 didiforgithub

This issue has no activity in the past 30 days. Please comment on the issue if you have anything to add.

github-actions[bot] avatar Jun 19 '25 00:06 github-actions[bot]

This issue was closed due to 45 days of inactivity. If you feel this issue is still relevant, please reopen the issue to continue the discussion.

github-actions[bot] avatar Jul 03 '25 00:07 github-actions[bot]