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

Improve error message when bot fails to find pets #61

Open
andreped opened this issue Apr 11, 2023 · 5 comments
Open

Improve error message when bot fails to find pets #61

andreped opened this issue Apr 11, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@andreped
Copy link
Owner

What might happen is that the bot might completely fail to find any pets, even though there are some.

A cause to this could be that the user did not use fullscreen, or accidentally opened the terminal or left the game, while the bot was making actions.

This results in the error message below, which should be catched and a better verbose shall be given to the user.

Error log:

(venv) PS C:\Users\andrp\workspace\super-ml-pets> python .\main.py --task deploy --infer_model .\models\model_sap_gym_sb3_180822_checkpoint_2175_steps
INFO main.py 53 Pausing...
INFO main.py 56 Running...
INFO deploy_agent.py 94 INITIALIZATION [self.run]: Loading Model
INFO deploy_agent.py 97 INITIALIZATION [self.run]: Create SuperAutoPetsEnv Object
INFO deploy_agent.py 104 CV SYSTEM [self.run]: Detect the Pets and Food in the Shop Slots
INFO deploy_agent.py 106 CV SYSTEM [self.run]: Calls [image_detection.find_the_animals]
Traceback (most recent call last):
  File ".\main.py", line 63, in <module>
    main()
  File ".\main.py", line 57, in main
    run(ret)
  File "C:\Users\andrp\workspace\super-ml-pets\smp\deploy_agent.py", line 109, in run
    directory=os.path.join(os.path.dirname(os.path.abspath(__file__)), "SAP_res/").replace("\\", "/"))
ValueError: not enough values to unpack (expected 2, got 0)
@andreped andreped added the enhancement New feature or request label Apr 11, 2023
@adjmathix
Copy link

I noticed that there was a graphic update in the game, so the animals in-game aren't looking like the ones in SAP_res.

@andreped
Copy link
Owner Author

andreped commented Oct 4, 2023

I noticed that there was a graphic update in the game, so the animals in-game aren't looking like the ones in SAP_res.

You need to do step 3 described in the Usage (see README). Then you will change back to the old style of the pets in the game.

@andreped
Copy link
Owner Author

@adjmathix The same thing was just now also reported in #70.

It seems you are right. All food templates needs to be updated... We move the discussion over to #70

@andreped andreped mentioned this issue Nov 6, 2023
@MasonLyons
Copy link

What might happen is that the bot might completely fail to find any pets, even though there are some.

A cause to this could be that the user did not use fullscreen, or accidentally opened the terminal or left the game, while the bot was making actions.

This results in the error message below, which should be catched and a better verbose shall be given to the user.

Error log:

(venv) PS C:\Users\andrp\workspace\super-ml-pets> python .\main.py --task deploy --infer_model .\models\model_sap_gym_sb3_180822_checkpoint_2175_steps
INFO main.py 53 Pausing...
INFO main.py 56 Running...
INFO deploy_agent.py 94 INITIALIZATION [self.run]: Loading Model
INFO deploy_agent.py 97 INITIALIZATION [self.run]: Create SuperAutoPetsEnv Object
INFO deploy_agent.py 104 CV SYSTEM [self.run]: Detect the Pets and Food in the Shop Slots
INFO deploy_agent.py 106 CV SYSTEM [self.run]: Calls [image_detection.find_the_animals]
Traceback (most recent call last):
  File ".\main.py", line 63, in <module>
    main()
  File ".\main.py", line 57, in main
    run(ret)
  File "C:\Users\andrp\workspace\super-ml-pets\smp\deploy_agent.py", line 109, in run
    directory=os.path.join(os.path.dirname(os.path.abspath(__file__)), "SAP_res/").replace("\\", "/"))
ValueError: not enough values to unpack (expected 2, got 0)

Related to this, would you accept a PR improving the overall logging of the project?

I've changed the code locally to also log to a file and output the filename, line and function in all logs. I've also cleaned up the formatting and changed the use of format to f-strings.

@andreped
Copy link
Owner Author

Should be fixed in 5ce7b66.

But I need to run some tests tomorrow on my Windows laptop.

Basically, all food and pet items have now been updated:
5ce7b66

@andreped andreped self-assigned this Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

3 participants