ClementPinard / SfmLearner-Pytorch

Pytorch version of SfmLearner from Tinghui Zhou et al.
MIT License
1.01k stars 224 forks source link

Cannot run `train.py` with nohup #141

Closed ghost closed 2 years ago

ghost commented 2 years ago

The following commands work well,

python train.py /path/to/the/formatted/data/ -b4 -m0.2 -s0.1 --epoch-size 3000 --sequence-length 3 --log-output

while the following commands give errors

nohup python train.py /path/to/the/formatted/data/ -b4 -m0.2 -s0.1 --epoch-size 3000 --sequence-length 3 --log-output &

I noticed this is caused by the following line in the logger.py file refers to the height of the terminal h. https://github.com/ClementPinard/SfmLearner-Pytorch/blob/master/logger.py#L16

I got around the problem by hard-coding the h here, but this is a very lame way of doing it. If anyone knows of a more generic solution, please let me know.

ClementPinard commented 2 years ago

Hi, sounds like a blessings bug. You might want to file an issue.

What you can do is to launch the original command inside a screen instead of with nohup, or add a general option for a simpler log that won't use blessings.

Would be interesting to consider using blessed instead of blessings : https://github.com/jquast/blessed

ghost commented 2 years ago

Thank you for your comment. I attempted to run the command by my computer in the background and it took me a little while to realise why below command wasn't working in the background.

I did not know the repository that you showed. It is interesting to solve problems related to the terminal and also to play with it.

Thank you for your suggestive reply.