biorobotics / biorobotics/PRD-MAPPO

Unable to generate GIF image

Open
#2 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
13
Forks
0
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the reported paths in MA_Controller/multiagent-particle-envs/multiagent/rendering.py at line 101 and MA_Controller/multiagent1.py at lines 160 and 233. Compare the rgb_array and human render modes, then verify that GIF generation completes without either reported exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.