anishathalye / seashells

The official client for seashells.io 🐚
https://seashells.io
MIT License
708 stars 20 forks source link

Breaks with tqdm #3

Closed joshuagruenstein closed 7 years ago

joshuagruenstein commented 7 years ago

For some reason, tqdm and seashells do not play nice. This is sad, as tqdm is nice for monitoring large training batches.

mdraw commented 7 years ago

I assume with "do not play nice" you mean that tqdm output does not appear on your seashells page. If you just run

$ somecommand | seashells

only the stdout stream is piped to seashells. By default tqdm does not write to stdout but to stderr, so to make your progress bars appear on seashells, you will either have to pass file=sys.stdout to tqdm, for example:

import sys
import time
from tqdm import tqdm
for _ in tqdm(range(100), file=sys.stdout)):
    time.sleep(0.1)

or alternatively, pipe both stdout and stderr to seashells in your shell:

$ somecommand 2>&1 | seashells
joshuagruenstein commented 7 years ago

Thank you, this is helpful.