代码拉取完成,页面将自动刷新
运行命令:
C:\Users\Huan\Anaconda3\envs\py37\python.exe E:/projects/python/paddle_learn/PaddleDetection/tools/train.py -c configs/yolov3_mobilenet_v1_roadsign.yml --use_vdl=true --vdl_log_dir=vdl_dir/scalar --eval
错误日志:
Traceback (most recent call last):
File "E:/projects/python/paddle_learn/PaddleDetection/tools/train.py", line 375, in <module>
main()
File "E:/projects/python/paddle_learn/PaddleDetection/tools/train.py", line 70, in main
cfg = load_config(FLAGS.config)
File "E:\projects\python\paddle_learn\PaddleDetection\ppdet\core\workspace.py", line 86, in load_config
cfg = merge_config(yaml.load(f, Loader=yaml.Loader), cfg)
File "C:\Users\Huan\Anaconda3\envs\py37\lib\site-packages\yaml\__init__.py", line 112, in load
loader = Loader(stream)
File "C:\Users\Huan\Anaconda3\envs\py37\lib\site-packages\yaml\loader.py", line 44, in __init__
Reader.__init__(self, stream)
File "C:\Users\Huan\Anaconda3\envs\py37\lib\site-packages\yaml\reader.py", line 85, in __init__
self.determine_encoding()
File "C:\Users\Huan\Anaconda3\envs\py37\lib\site-packages\yaml\reader.py", line 124, in determine_encoding
self.update_raw()
File "C:\Users\Huan\Anaconda3\envs\py37\lib\site-packages\yaml\reader.py", line 178, in update_raw
data = self.stream.read(size)
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa1 in position 41: illegal multibyte sequence
问题文件:
PaddleDetection\ppdet\core\workspace.py
cfg = AttrDict()
with open(file_path) as f:
问题原因:
文件open时没有指定 encoding='UTF-8',使用GBK打开yml
修改如下:
cfg = AttrDict() with open(file_path, encoding='UTF-8') as f: