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

How to render the environment? #40

Closed
77asadian opened this issue Oct 22, 2022 · 24 comments
Closed

How to render the environment? #40

77asadian opened this issue Oct 22, 2022 · 24 comments
Assignees
Labels
bug Something isn't working

Comments

@77asadian
Copy link

Hi,

I want to render the base code that I performed here:

image

Can you please help me with this?

@alexpalms
Copy link
Member

Thank you for opening this @77asadian. So, you are running this inside a jupyter notebook right?

@77asadian
Copy link
Author

Thank you for opening this @77asadian. So, you are running this inside a jupyter notebook right?

Yes, I'm running this in jupyter notebook.

@alexpalms
Copy link
Member

Can you share your OS version and a screenshot of the shell where you started jupyter notebook?

@77asadian
Copy link
Author

I'm using Windows Home 21H1.
Here is the screenshot you asked for:

image

@alexpalms
Copy link
Member

I just tested it and in my configuration it works:

Screenshot from 2022-10-22 16-32-09

I am using the python notebook example file provided in our repo: https://github.com/diambra/arena/blob/main/examples/diambra_arena_gist.ipynb

@alexpalms
Copy link
Member

alexpalms commented Oct 22, 2022

I'm using Windows Home 21H1. Here is the screenshot you asked for:

image

It seems there are problems with the widget control, let me check.

@alexpalms
Copy link
Member

But no, I have the same message/warning here and everything works. Can you please comment the rendering and see if, on this same console, it prints out logs demonstrating it is proceeding?

@alexpalms
Copy link
Member

You should be seeing something like this:
Screenshot from 2022-10-22 16-40-22
Screenshot from 2022-10-22 16-40-08

@77asadian
Copy link
Author

There was no rendering window opening for me.
I commented the render line and there is no output log.
image

@alexpalms
Copy link
Member

There was no rendering window opening for me. I commented the render line and there is no output log. image

Two things:

  1. be careful with that comment since it is not indented and can give problems, just to be sure, remove the line

  2. I am referring to comments in the shell/console where you launched jupyter notebook (where you typed diambra run ...)

@77asadian
Copy link
Author

I'm seeing this:

image

image

@alexpalms
Copy link
Member

alexpalms commented Oct 22, 2022

I'm seeing this:

image

image

Looks all good. Please at the bottom confirm there is something like "Waiting for fight to start"

Don't mind that thing where you put an arrow, it's normal

@77asadian
Copy link
Author

I'm seeing this:
image
image

Looks all good. Please at the bottom confirm there is something like "Waiting for fight to start"

Don't mind about that thing where you put an arrow, it's normal

Is it this?

image

@alexpalms
Copy link
Member

Yes, but please share also the most recent logs/outputs

@77asadian
Copy link
Author

image

image

There are so many codes here. I hope this would help.

@alexpalms
Copy link
Member

everything seems to be executed properly. Add print("Reward = ", reward) before the if done: condition in the script

then run the script again and let's see if it is correctly running

@77asadian
Copy link
Author

print("Reward = ", reward)

image

We have some rewards here.

@alexpalms
Copy link
Member

yes, so everything is working.

It is strange you are not able to see the rendered screen. Need to check it on Win. You're not using a virtual machine or a headless configuration right?

@77asadian
Copy link
Author

yes, so everything is working.

It is strange you are not able to see the rendered screen. Need to check it on Win. You're not using a virtual machine or a headless configuration right?

No, my OS is not running on a virtual machine. I'm using a Lenovo Legion 5 laptop.

@alexpalms
Copy link
Member

alexpalms commented Oct 22, 2022

Can you do the following test? Add the following lines at the top of your jupyter script:

import os
print(os.getenv("DISPLAY"))

and past here the output

@77asadian
Copy link
Author

image

It seems there is no display.

@alexpalms
Copy link
Member

alexpalms commented Oct 22, 2022

Ok so that is the problem, cause we use that check to decide if showing or not the render image. But it could be we need a different check for windows, I'll carry out some tests and let you know.

In the meantime you can use it without rendering.

@alexpalms alexpalms self-assigned this Oct 22, 2022
@alexpalms alexpalms added the bug Something isn't working label Oct 22, 2022
@77asadian
Copy link
Author

Ok so that is the problem, cause we use that check to decide if showing or not the render image. But it could be we need a different check for windows, I'll carry out some tests and let you know.

In the meantime you can use it without rendering.

Thank you for your help. I'm looking forward to your response.

@alexpalms
Copy link
Member

Hey @77asadian, just pushed a new diambra-arena version (https://pypi.org/project/diambra-arena/ v2.0.0rc8) implementing the fix that solves this (tested on Win), this is the commit: 35bde2b

You should update your python environment installing the latest version with pip install -U diambra-arena and re-run the simplest example (diambra_gym_gist.py) with env.render() active.

Please confirm that you're able to see the rendering so that we can close the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants