用 os.getcwd() 获取到的是服务器根目录的路径,
而不是文件所在的项目文件里的路径
从别人源代码里注意了到此问题的解决方法,
ROOT_DIR = os.path.dirname(os.path.realpath(__file__))
参考代码 github : ResEncoder/config.py at master · easonnie/ResEncoder · GitHubThis repo is for residual-connected sentence encoder for NLI. - ResEncoder/config.py at master · easonnie/ResEncoderhttps://github.com/easonnie/ResEncoder/blob/master/config.py