Page 1 of 1

Crash: Inappropriate ioctl for device

Posted: Sun Feb 23, 2020 6:46 pm
by blackomen

Here's what I'm getting when I try to run this on a cloud service:

02/23/2020 13:43:13 INFO Loading data, this may take a while...
02/23/2020 13:43:13 INFO Loading Model from Dfaker plugin...
02/23/2020 13:43:13 INFO No existing state file found. Generating.
02/23/2020 13:43:14 ERROR Got Exception on main handler:
Traceback (most recent call last):
File "/home/paperspace/faceswap/lib/cli.py", line 128, in execute_script
process.process()
File "/home/paperspace/faceswap/scripts/train.py", line 157, in process
err = self._monitor(thread)
File "/home/paperspace/faceswap/scripts/train.py", line 343, in monitor
keypress = KBHit(is_gui=self.
args.redirect_gui)
File "/home/paperspace/faceswap/lib/keypress.py", line 42, in init
self.new_term = termios.tcgetattr(self.file_desc)
termios.error: (25, 'Inappropriate ioctl for device')

My crash log is attached


Re: Crash: Inappropriate ioctl for device

Posted: Mon Feb 24, 2020 9:52 am
by torzdf

I assume you are running this in a Jupyter Notebook of some kind?

We have a function that monitors for multiple key presses. As Faceswap is multi-platform, we rely on a third party lib to monitor the terminal for key presses. It would appear that this doesn't play nicely with PaperSpace.

This is unlikely to be fixed (I cannot test in the environment you are in), so you may need to hack around in the code.


Re: Crash: Inappropriate ioctl for device

Posted: Mon Feb 24, 2020 9:37 pm
by blackomen

No, I was trying to run it from the command line from my cloud service (after failing to get the GUI to work via VNC.) I used the Generate button on my local computer's copy to get the commands and uploaded my faces and alignments to my cloud service and adjusted the paths in the generated command. I then ran try to run the generated command with a "nohup" in front and "> train.log &" after to get it to run indefinitely and to log to a file.


Re: Crash: Inappropriate ioctl for device

Posted: Tue Feb 25, 2020 12:20 am
by torzdf

It's entirely possible that nohup is hiding the terminal from Faceswap, hence why you get that error (no terminal = nothing to monitor = error).

I suggest installing screen, and launching faceswap there (so you can happily leave it running and just log back into the session to check progress).

https://help.ubuntu.com/community/Screen

Also, Faceswap automatically logs to file, so redirecting stdout is not necessary.


Re: Crash: Inappropriate ioctl for device

Posted: Tue Feb 25, 2020 2:17 am
by blackomen

Yeah, it works when ran normally from the terminal alright. However, I don't like the idea that losing my SSH connection will terminate my training. I'll look into maybe running this on Jupyter instead (esp since I got it to work on colab but it'll be nice to be able to train multiple models simultaneously on colab, my cloud provider, and my local machine.)


Re: Crash: Inappropriate ioctl for device

Posted: Tue Feb 25, 2020 9:02 am
by torzdf
blackomen wrote: Tue Feb 25, 2020 2:17 am

I don't like the idea that losing my SSH connection will terminate my training.

This is precisely why I suggested Screen. You should look into it... it's entire existence is so you can connect and disconnect to terminals without terminating the running applications.