AttributeError: 'Monitor' object has no attribute 'pipe'
xufeng1024 opened this issue · comments
Hello, I have an error when I run test.py.
python3 test.py Traceback (most recent call last): File "test.py", line 68, in <module> test(opt) File "test.py", line 58, in test state, reward, done, info = env.step(action) File "/home/pluto/Super-mario-bros-A3C-pytorch/src/env.py", line 76, in step state, reward, done, info = self.env.step(action) File "/home/pluto/Super-mario-bros-A3C-pytorch/src/env.py", line 51, in step self.monitor.record(state) File "/home/pluto/Super-mario-bros-A3C-pytorch/src/env.py", line 26, in record self.pipe.stdin.write(image_array.tostring())
AttributeError: 'Monitor' object has no attribute 'pipe'
The error appears in the env.py file.
try: self.pipe = sp.Popen(self.command, stdin=sp.PIPE, stderr=sp.PIPE) except FileNotFoundError: pass def record(self, image_array): self.pipe.stdin.write(image_array.tostring())
I tried to modify the code but it didn't work. Can you help me?
I tried to remove ‘try...except...’
from env.py
. After that, it appeared:
FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg': 'ffmpeg'
First of all, thank you.
The error is due to the fact that ffmpeg is not installed.
sudo apt-get install ffmpeg
Finally successfully run the program.
The environment of this program is a bit cumbersome.
Thanks again.