在一些深度学习项目中,特别是要放到linux环境下跑,那么就可能需要绝对路径,但那样太麻烦,加下面这一句解决问题:
os.chdir("/whf_fix/whf/pytorch_code/Semi_Surpervised")
到此,就可以使用相对路径啦。