got an unexpected keyword argument 多半是pytorch版本问题
查看源文件,没有reduction这个参数,但是官方文档里有。
import torch
print(torch.__version__)
输出:0.4.0
卸载旧版本
pip3 install http://download.pytorch.org/whl/cpu/torch-0.4.1-cp36-cp36m-win_amd64.whl
安装新版本
pip uninstall torch
版本更新为0.4.1
成功运行