Problem 1. 调包失败
在这样的层级架构里调包,输出无法找到 mega_nerf
直接用 sys.path.append()
没有作用
# import sys
# print(sys.path)
# sys.path.append("/home/paper/Desktop/meganerf/mega_nerf/") # 对3.6.7以上python版本不适用
解决方案
在开头添加:
import sys
import os
dir_path=os.path.dirname(os.path.realpath(__file__))
parent_dir_path=os.path.abspath(os.path.join(dir_path, os.pardir))
sys.path.insert(0,parent_dir_path)
Problem 2. pip install失败
pip install ConnectTimeoutError,添加对应镜像网站。
# 阿里云镜像 http://mirrors.aliyun.com/pypi/simple/
# 清华镜像 https://pypi.tuna.tsinghua.edu.cn/simple/
# 中科大镜像
pip install XX --index-url https://pypi.douban.com/simple
Problem 3. torch.jit.save()保存模型以 .pth
作为路径结尾
# 两种存储方式
torch.jit.save(m, 'non/existent/path/model.pth')
torch.save(m, 'non/existent/path/model.pth')
torch.jit.save() produces complex c++ error when path does not exist