Comments (1)
To solve:
Scroll to end of render.py in magent2 python library folder. Add the link pygame.event.pump()
above the line if self.mode == "human":
observation = pygame.surfarray.pixels3d(self.display)
new_observation = np.copy(observation)
del observation
################
pygame.event.pump()
################
if self.mode == "human":
pygame.display.flip()
return (
np.transpose(new_observation, axes=(1, 0, 2))
if mode == "rgb_array"
else None
)
This will cause issues with using the close button. If you need to use the close button, here is another option. You will need to add import sys
and from pygame.locals import QUIT
to the render function in the same render.py. Then add the highlighted code below.
observation = pygame.surfarray.pixels3d(self.display)
new_observation = np.copy(observation)
del observation
###################
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
###################
if self.mode == "human":
pygame.display.flip()
return (
np.transpose(new_observation, axes=(1, 0, 2))
if mode == "rgb_array"
else None
)
from magent2.
Related Issues (15)
- Prebuild mac wheels once Github Actions supports M1
- ModuleNotFoundError: No module named 'magent2.environments' HOT 4
- Installation issues on Linux HOT 1
- Installation issues on Macos Python3.8 HOT 5
- Early Termination
- Editable install and local install issues HOT 1
- TypeError: reset_wait() got an unexpected keyword argument 'seed'
- Is there any pre-trained model or scripted AI?
- Could this be installed on window? HOT 1
- env.reset() crashed in basic usage example HOT 4
- How do I customize the environment in this?
- The problem of tiger_deer_v4 scenario
- env.reset() HOT 3
- How to know if an agent is in another's attack range? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from magent2.