Error when calling files across directories, NameError: name'nemo' is not defined

As shown in the picture:

tacotron2.py in the examples directory reports an error when calling nemo, where example and nemo are at the same level. The solution is as follows:

import os,sys
base_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(base_dir)

Change the absolute path to a relative path and add it to the environment variable to solve it. 

 

Guess you like

Origin blog.csdn.net/weixin_45191152/article/details/104196136
Recommended