AttributeError: 'Monitor' object has no attribute 'pipe'
VicenHe opened this issue · comments
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?
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.
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?
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
.
Comment out the lines in the
create_train_env
method in theenv.py
file:# if output_path: # monitor = Monitor(256, 240, output_path) # else: # monitor = Noneand add
monitor = None
.
第二种方法参考:https://blog.csdn.net/m0_47449768/article/details/130102406