torch.load(save_path): *** FileNotFoundError: [Errno 2] No such file or directory:错误原因:更改结果:
*** FileNotFoundError: [Errno 2] No such file or directory: '~/DeepLearning/.../XXXXXnet.pth'对应的代码为:weight_path = '~/DeepLearning/......'save_path = os.path.join(weight_path, save_filename)错误原因:这里是python不是linux,~在Python里不能直接代表主目录,所以要用绝对路径。更改.