geograz / Tunnel-automation-with-Reinforcement-Learning-TunnRL-

Code repository for the paper "Reinforcement Learning based Process Optimization and Strategy Development in Conventional Tunneling" by G.H. Erharter, T.F. Hansen, Z. Liu and T. Marcher
MIT License
8 stars 3 forks source link

problems with videocapture #5

Open tfha opened 3 years ago

tfha commented 3 years ago

I have solved the path-problem for linux but I have now got this error-messages with videocapture. I didn't find the error. It seems like there could be something with the cv2 import. In addition to the error message below, I get some the error from the attached image :

File "/home/tfha/projects/Reinforcement_Learning_for_Geotechnics/00_main.py", line 231, in pltr.render_episode(Path('02_plots/tmp'), fps=2, x_pix=1680, y_pix=480, File "/home/tfha/projects/Reinforcement_Learning_for_Geotechnics/E_plotter.py", line 294, in render_episode out = cv2.VideoWriter(savepath, fourcc, fps, (x_pix, y_pix)) TypeError: VideoWriter() missing required argument 'frameSize' (pos 5)

image

geograz commented 3 years ago

intersting behavior, especially as it has stopped working for me too now. I am getting the error message: TypeError: VideoWriter() missing required argument 'frameSize' (pos 5) ... which of course doesn't make sense as it is getting the frame size. When I tried to explicitly set that it threw another error: TypeError: VideoWriter() missing required argument 'apiPreference' (pos 2) ... and explicitly setting this resulted in: SystemError: <class 'cv2.VideoWriter'> returned NULL without setting an error

Anyway, I could track down the problem and after deleting all Path() functions from the render_episode function and the respective part of the code in 00_main.py it started to work again. So I'd conclude opencv does not like the Path() function.