WuJie1010 / Facial-Expression-Recognition.Pytorch

A CNN based pytorch implementation on facial expression recognition (FER2013 and CK+), achieving 73.112% (state-of-the-art) in FER2013 and 94.64% in CK+ dataset
MIT License
1.77k stars 546 forks source link

An error about stty #140

Open jiangtianyise opened 1 year ago

jiangtianyise commented 1 year ago

_, term_width = os.popen('stty size', 'r').read().split() ValueError: not enough values to unpack (expected 2, got 0) Can you tell me how to fix the problem?

shreyakjr10 commented 9 months ago

indicates that the os.popen('stty size', 'r').read().split() line is not returning the expected output. This is likely because the stty size command did not return the expected result.The stty size command is used to get the size of the terminal window in rows and columns. It should return something like 24 80 to represent a terminal with 24 rows and 80 columns. However, if your terminal or environment does not support the stty size command, it will return an empty string or something different, leading to the error you encountered.

To fix the problem, you can handle cases where the stty size command does not return the expected output. You can do this by using a try-except block to catch the error and provide a default value for term_width and term_height. Here's an example of how to do it:

** import os

try: term_height, term_width = os.popen('stty size', 'r').read().split() except ValueError:

Handle the case where 'stty size' did not return the expected result

term_height = 24  # Provide a default value
term_width = 80   # Provide a default value

**

jiangtianyise commented 8 months ago

Thank you very much,I have fixed the issue

yichangjianduan commented 3 months ago

非常感谢,我已经解决了这个问题

请问怎么解决的呀 我也是有这个问题