类似上图这种结构,resnet_inference.py中需要导入tools中的py文件,代码为
import sys
sys.path.append("..")
from tools.common_tools import ModelTrainer
需要注意的是,被引用文件夹中必须创建__init__.py,空文件也没关系
类似上图这种结构,resnet_inference.py中需要导入tools中的py文件,代码为
import sys
sys.path.append("..")
from tools.common_tools import ModelTrainer
需要注意的是,被引用文件夹中必须创建__init__.py,空文件也没关系