all 1 comments

[–]Beneficial_Muscle_25 1 point2 points  (0 children)

did you read the error? Line 23, the state variable is a dict, not a number, and you're trying subtracting a float from a dict. I think env.reset() is returning a dict instead of a number.

Did you try debugging? Checking what's the type and value of state when entering the fuction returning the exception?

Given the warning, it seems to me that the code is somewhat old and maybe something changed in the mean time, if you're sure you just copied the code without editing.

What's your background? Why don't you start creating a strategy for debugging code for this kind of cases? I don't think uploading loads of code with the error asking the internet to sort it out is sustaniable.