小编pie*_*pie的帖子

错误UnicodeDecodeError:'utf-8'编解码器无法解码位置0的字节0xff:无效的起始字节

https://github.com/affinelayer/pix2pix-tensorflow/tree/master/tools

在上面的网站上编译"process.py"时发生错误.

 python tools/process.py --input_dir data --            operation resize --outp
ut_dir data2/resize
data/0.jpg -> data2/resize/0.png
Run Code Online (Sandbox Code Playgroud)

Traceback(最近一次调用最后一次):

File "tools/process.py", line 235, in <module>
  main()
File "tools/process.py", line 167, in main
  src = load(src_path)
File "tools/process.py", line 113, in load
  contents = open(path).read()
      File"/home/user/anaconda3/envs/tensorflow_2/lib/python3.5/codecs.py", line 321, in decode
  (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode     byte 0xff in position 0: invalid start byte
Run Code Online (Sandbox Code Playgroud)

错误的原因是什么?Python的版本是3.5.2.

python utf-8 python-3.x

127
推荐指数
11
解决办法
40万
查看次数

标签 统计

python ×1

python-3.x ×1

utf-8 ×1