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

AttributeError: 'Monitor' object has no attribute 'pipe' #19

Open
VicenHe opened this issue Nov 16, 2021 · 4 comments
Open

AttributeError: 'Monitor' object has no attribute 'pipe' #19

VicenHe opened this issue Nov 16, 2021 · 4 comments

Comments

@VicenHe
Copy link

VicenHe commented Nov 16, 2021

While testing the model i get this:
Traceback (most recent call last):
File "test.py", line 65, in
test(opt)
File "test.py", line 55, in test
state, reward, done, info = env.step(action)
File "C:\Users\johnm\DeepLearning\Super-mario-bros-PPO-pytorch\src\env.py", line 100, in step
state, reward, done, info = self.env.step(action)
File "C:\Users\johnm\DeepLearning\Super-mario-bros-PPO-pytorch\src\env.py", line 55, in step
self.monitor.record(state)
File "C:\Users\johnm\DeepLearning\Super-mario-bros-PPO-pytorch\src\env.py", line 27, in record
self.pipe.stdin.write(image_array.tostring())
AttributeError: 'Monitor' object has no attribute 'pipe'
Can you help please?

@TheBeautifulMoonlight
Copy link

I met the same issue at test. So I found the problem is in /src/env.py Class Monitor. And the reason is that we did not install ffmpeg. So the Monitor didn't create self.pipe. To solve this problem we can Install ffmpeg or Block the class Monitor.

@Liuchaochao7
Copy link

I met the same issue at test. So I found the problem is in /src/env.py Class Monitor. And the reason is that we did not install ffmpeg. So the Monitor didn't create self.pipe. To solve this problem we can Install ffmpeg or Block the class Monitor.

Hey, my bro, I met the same problem, and I installed ffmpeg, but the problem is still exists. How did you install ffmpeg? pip install ffmpeg?

@wenjian11
Copy link

Comment out the lines in the create_train_env method in the env.py file:

# if output_path:
#     monitor = Monitor(256, 240, output_path)
# else:
#     monitor = None

and add monitor = None.

@wenjian11
Copy link

Comment out the lines in the create_train_env method in the env.py file:

# if output_path:
#     monitor = Monitor(256, 240, output_path)
# else:
#     monitor = None

and add monitor = None.

第二种方法参考:https://blog.csdn.net/m0_47449768/article/details/130102406

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

4 participants