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

Unable to generate GIF image #2

Open
RL-is-too-difficult opened this issue Dec 4, 2024 · 0 comments
Open

Unable to generate GIF image #2

RL-is-too-difficult opened this issue Dec 4, 2024 · 0 comments

Comments

@RL-is-too-difficult
Copy link

RL-is-too-difficult commented Dec 4, 2024

Hello author: I downloaded the movie version v0.2.2.12, but I'm not sure if this is the correct version of the movie you wrote in your code. However, I encountered some issues while generating GIF images. If the render mode is selected as rgb_array:

images. append (np. squeeze (self. env. render (mode='rgb_array ')), an error will be generated:

Traceback (most recent call last):
File "C:\Users\liu\Desktop\PRD-MAPPO-main\Agent MPE\MA_Controller\main.py", line 66, in
ma_controller.run()
File "C:\Users\liu\Desktop\PRD-MAPPO-main\Agent MPE\MA_Controller\multiagent1.py", line 160, in run
images.append(np.squeeze(self.env.render(mode='rgb_array')))
File "C:\Users\liu\Desktop\PRD-MAPPO-main\Agent MPE\MA_Controller\multiagent-particle-envs\multiagent\environment.py", line 332, in render
results.append(self.viewers[i].render(return_rgb_array = mode=='rgb_array'))
File "C:\Users\liu\Desktop\PRD-MAPPO-main\Agent MPE\MA_Controller\multiagent-particle-envs\multiagent\rendering.py", line 101, in render
arr = np.fromstring(image_data.data, dtype=np.uint8, sep='')
AttributeError: 'ImageData' object has no attribute 'data'

If the mode is selected as human, an error will occur:

Traceback (most recent call last):
File "C:\Users\liu\Desktop\PRD-MAPPO-main\Agent MPE\MA_Controller\main.py", line 66, in
ma_controller.run()
File "C:\Users\liu\Desktop\PRD-MAPPO-main\Agent MPE\MA_Controller\multiagent1.py", line 233, in run
self.make_gif(np.array(images),self.gif_path)
File "C:\Users\liu\Desktop\PRD-MAPPO-main\Agent MPE\MA_Controller\multiagent1.py", line 127, in make_gif
clip = ImageSequenceClip(list(images), fps=fps).resize(scale)
File "D:\anaconda\envs\PRD-MAPPO\lib\site-packages\moviepy\video\io\ImageSequenceClip.py", line 133, in init
if with_mask and (self.sequence[0].shape[2]==4):
IndexError: tuple index out of range
May I ask if you have a solution to this problem

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

No branches or pull requests

1 participant