A UnicodeDecodeError when run the code:
Created by: qingweihk
The error are as flowing:
UnicodeDecodeError Traceback (most recent call last) in () 18 fnames = os.listdir(imgs_dir) 19 for f in fnames: ---> 20 data = open(os.path.join(imgs_dir, f)).read() 21 img = transform(data, ops)
/usr/lib/python3.6/codecs.py in decode(self, input, final) 319 # decode input (taking the buffer into account) 320 data = self.buffer + input --> 321 (result, consumed) = self._buffer_decode(data, self.errors, final) 322 # keep undecoded input until the next call 323 self.buffer = data[consumed:]
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte