crewAI icon indicating copy to clipboard operation
crewAI copied to clipboard

Error While Training the Crew

Open gergirod opened this issue 1 year ago • 4 comments

raise Exception(f"An error occurred while training the crew: {e}") Exception: An error occurred while training the crew: 'improved_output' An error occurred while training the crew: Command '['poetry', 'run', 'train', '3']' returned non-zero exit status 1.

gergirod avatar Jul 11 '24 22:07 gergirod

Can you advise how you have setup your environment?

theCyberTech avatar Jul 12 '24 13:07 theCyberTech

my crew use gpt-4o and use exa apis to search contents, find similar. please let me know if you need more info. thanks

gergirod avatar Jul 12 '24 13:07 gergirod

Am seeing a similar error as below too when I run the training and then say "this is good". Project is in vscode, structure based on 'crewai create crew <project_name>'

These are my dependencies in toml file: [tool.poetry.dependencies] python = ">=3.10,<=3.13" crewai = { extras = ["tools"], version = ">=0.61.0,<1.0.0" } load-dotenv = "^0.1.0" langchain-groq = "0.1.10" langchain-community = "0.2.17" duckduckgo-search = "^6.2.12"

Traceback (most recent call last): File "D:\Python Projects\cheekyfoot_writers\writers\src\writers\main.py", line 36, in train WritersCrew().crew().train(n_iterations=int(sys.argv[1]), filename=sys.argv[2], inputs=inputs) File "C:\Users\user\AppData\Local\pypoetry\Cache\virtualenvs\cheekyfoot_writers-qZl_KP0W-py3.12\Lib\site-packages\crewai\crew.py", line 419, in train
result = TaskEvaluator(agent).evaluate_training_data( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\user\AppData\Local\pypoetry\Cache\virtualenvs\cheekyfoot_writers-qZl_KP0W-py3.12\Lib\site-packages\crewai\utilities\evaluators\task_evaluator.py", line 119, in evaluate_training_data f"Improved Output:\n{data['improved_output']}\n\n" ~~~~^^^^^^^^^^^^^^^^^^^ KeyError: 'improved_output'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "D:\Python Projects\writers\writers\src\writers\main.py", line 39, in train raise Exception(f"An error occurred while training the crew: {e}") Exception: An error occurred while training the crew: 'improved_output' An error occurred while training the crew: Command '['poetry', 'run', 'train', '2', 'identify_writers.pkl']' returned non-zero exit status 1.

cal88 avatar Sep 21 '24 09:09 cal88

Looking into it

joaomdmoura avatar Sep 26 '24 13:09 joaomdmoura

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Dec 12 '24 06:12 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Dec 17 '24 12:12 github-actions[bot]

Is there any news on this? I'm facing the same issue while training the crew

iuliakhomenko avatar Jan 05 '25 09:01 iuliakhomenko

Hi I am also facing the same issue could you please look into this ? raise Exception(f"An error occurred while training the crew: {e}") Exception: An error occurred while training the crew: 'improved_output' An error occurred while training the crew: Command '['uv', 'run', 'train', '3', 'trained_agents_data.pkl']' returned non-zero exit status 1.

Yeswanth-gif avatar Jan 05 '25 12:01 Yeswanth-gif

Also one more thing everytime i was giving output i guess its not storing the output as it was failing like below.

Thats good but please replace the urls also with complete urls Human feedback: Thats good but please replace the urls also with complete urls 2025-01-05 18:02:52,906 - 856162480 - llm.py-llm:170 - ERROR: LiteLLM call failed: litellm.BadRequestError: Invalid Message bedrock requires at least one non-system message Error during LLM call to classify human feedback: litellm.BadRequestError: Invalid Message bedrock requires at least one non-system message. Retrying... (1/3) 2025-01-05 18:02:52,917 - 856162480 - llm.py-llm:170 - ERROR: LiteLLM call failed: litellm.BadRequestError: Invalid Message bedrock requires at least one non-system message Error during LLM call to classify human feedback: litellm.BadRequestError: Invalid Message bedrock requires at least one non-system message. Retrying... (2/3) 2025-01-05 18:02:52,930 - 856692480 - llm.py-llm:170 - ERROR: LiteLLM call failed: litellm.BadRequestError: Invalid Message bedrock requires at least one non-system message Error during LLM call to classify human feedback: litellm.BadRequestError: Invalid Message bedrock requires at least one non-system message. Retrying... (3/3) Error processing feedback after multiple attempts.

Yeswanth-gif avatar Jan 05 '25 13:01 Yeswanth-gif

@joaomdmoura I'm facing this issue and blocked. Any thought on why is it happening? Is it a setup problem? Or a bug? Please, open our minds.

williamfunchal avatar Feb 10 '25 20:02 williamfunchal