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

'docs/img/city_map.jpeg' not found during rendering #240

Open
vmoens opened this issue Apr 29, 2024 · 3 comments · May be fixed by #251
Open

'docs/img/city_map.jpeg' not found during rendering #240

vmoens opened this issue Apr 29, 2024 · 3 comments · May be fixed by #251

Comments

@vmoens
Copy link

vmoens commented Apr 29, 2024

Calling render on "CVRP-v1" doesn't work because the docs/img/city_map.jpeg file cannot be opened:

map_img = plt.imread("docs/img/city_map.jpeg")

Perhaps a way of downloading that file in a cache could solve the issue?

@vmoens
Copy link
Author

vmoens commented Apr 29, 2024

A similar error occurs with "TSP-v1"

@clement-bonnet
Copy link
Collaborator

Hi, thank you for raising this issue! Will look into this shortly.

@vmoens
Copy link
Author

vmoens commented Apr 29, 2024

Cool!
FYI it's part of this PR
pytorch/rl#2129
which enables rendering of envs using from_pixels=True in torchrl

Sort of personal request: It'd be nice to have a way to ask for headless rendering / rgb_arrays in a consistent way (from my 10K feet high view it seems envs have a different way of dealing with rendering). Something like make(envname, rgb_array=True) or render(rgb_array=True).
For torchrl, we prefer always getting arrays of uint8 and deliver them to the users as part of their env output and leave them deal with them as they want (if the user wants to render smth they can just call plt.imshow(data["pixels"]))
Having the human rendering by default usually introduces some consequent overhead.

The way the above PR deals with this is to render on screen, record the content of the plt image in a buffer, convert that buffer to a tensor (since there is no generic way of getting a rgb).

@sash-a sash-a linked a pull request Oct 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants