MushroomRL / mushroom-rl

Python library for Reinforcement Learning.
MIT License
814 stars 148 forks source link

Unable to tun atari_dqn.py file in examples #141

Closed shreyassr123 closed 5 months ago

shreyassr123 commented 5 months ago

When I am trying to run atari_dqn.py in examples, I am getting the following error: File /opt/anaconda3/lib/python3.11/site-packages/mushroom_rl/utils/frames.py:50 in preprocess_frame image = cv2.cvtColor(obs, cv2.COLOR_RGB2GRAY)

error: OpenCV(4.9.0) :-1: error: (-5:Bad argument) in function 'cvtColor'

Overload resolution failed:

  • src is not a numerical tuple
  • Expected Ptr for argument 'src' I feel the error is due to the fact that the obs is a list containing both array and info.
boris-il-forte commented 5 months ago

Thanks for reporting!

Which version of mushroom are you using? If you are using the dev branch, it should be the expected outcome, as we are currently working on MushroomRL-v2, and we had to break some interfaces.

I suggest using a version from PIP and/or the dev-v1 branch

shreyassr123 commented 5 months ago

I am facing this issue in both the PIP and dev-v1 branches. Kindly look into it.

On Thu, May 16, 2024 at 5:19 PM Davide Tateo @.***> wrote:

Thanks for reporting!

Which version of mushroom are you using? If you are using the dev branch, it should be the expected outcome, as we are currently working on MushroomRL-v2, and we had to break some interfaces.

I suggest using a version from PIP and/or the dev-v1 branch

— Reply to this email directly, view it on GitHub https://github.com/MushroomRL/mushroom-rl/issues/141#issuecomment-2115017697, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYZNJL7MZELIB5JESZQXBW3ZCSMMLAVCNFSM6AAAAABHZPMBDKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJVGAYTONRZG4 . You are receiving this because you authored the thread.Message ID: @.***>

boris-il-forte commented 5 months ago

I'm unable to reproduce the behavior. If you are sure you are not using the dev branch as Mushroom installation and as Mushroom example, can you please let me know what version of gym and ale-py are you using?

shreyassr123 commented 5 months ago

The gym version is 0.26.2, and the ale-py version is 0.8.1. I installed mushroom_rl using pip, and the mushroom_rl version is 1.10.1. I don't think it is a dev branch; I checked by installing older versions also. However, now, I am able to run it in the terminal, but I am having these issues while running it using Anaconda-Spyder.

boris-il-forte commented 5 months ago

Ok, it's not a bug, it's simply a version of gym not supported by MushoroomRL.

If you want to use MushroomRL from pip/dev-v1 you must install gym==0.24.1.

Unfortunately, we froze to this quite poor version of gym, because the gym maintainers were constantly breaking the interface. MushroomRL 2.0 will jump directly to Gymnasium support, and it's already implemented. Unfortunately, Mushroom 2.0 is not currently working for Atari, as said above. We will try to do a mushroom 2.0 release late this summer.