sacred
sacred copied to clipboard
utf-8 codec error
Am encountering the following error mid-experiment.
File "/home/ubuntu/miniconda3/envs/cuda/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/home/ubuntu/miniconda3/envs/cuda/lib/python3.6/threading.py", line 1182, in run
self.function(*self.args, **self.kwargs)
File "/home/ubuntu/miniconda3/envs/cuda/lib/python3.6/site-packages/sacred/run.py", line 266, in _start_heartbeat
self._emit_heartbeat()
File "/home/ubuntu/miniconda3/envs/cuda/lib/python3.6/site-packages/sacred/run.py", line 333, in _emit_heartbeat
self._get_captured_output()
File "/home/ubuntu/miniconda3/envs/cuda/lib/python3.6/site-packages/sacred/run.py", line 257, in _get_captured_output
text = text.decode()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x96 in position 0: invalid start byte
Update: issue seems to be resolved when I disabled tqdm
. There must be a way to fix though?
That should not happen indeed. I'll dig into it next week. Is it enough to use the standard tqdm
progressbar for reproducing this?
BTW: I wasn't aware of tqdm
, but it seems extremely cool! Thanks :-)
I still encounter similar issue sometimes with tqdm=4.15.0 and sacred=0.7.1
Issues confirmed here also with tqdm:
File "/home/myhome/venv/lib/python3.5/site-packages/sacred/run.py", line 257, in _get_captured_output text = text.decode() UnicodeDecodeError: 'utf-8' codec can't decode byte 0x88 in position 0: invalid start byte
tqdm uses special characters to return at the beginning of line or even at the previous line (so it can update nested progress bars simultaneously on several lines). A (free) guess is that this character is the problem for text.decode() ?
@Qwlouse maybe it should be re opened ? (the first issue was caused by byte 0x96, now it's 0x88)
Guys, why don't you just add "ignore" to text.decode? It's only a output log.
I've run into it as well and it looks so far that just using tqdm(..., ascii=True) doesn't brick sacred.
I think this issue should be fixed now, so I'm closing it.
Thanks a lot !!!
Hi I am still getting this error:
with the latest version of tqdm and sacred...
Traceback (most recent call last):
File "/usr/lib/python2.7/contextlib.py", line 35, in exit self.gen.throw(type, value, traceback)
File "/usr/local/lib/python2.7/dist-packages/sacred/stdout_capturing.py", line 109, in tee_output_python out.finalize()
File "/usr/local/lib/python2.7/dist-packages/sacred/stdout_capturing.py", line 83, in finalize self.final = self.get()
File "/usr/local/lib/python2.7/dist-packages/sacred/stdout_capturing.py", line 72, in get self.buffer.seek(self.read_position)
File "/usr/lib/python2.7/StringIO.py", line 106, in seek self.buf += ''.join(self.buflist)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 1254: ordinal not in range(128)