很抱歉,如果这确实很基本。我正在尝试在最近的两分钟论文视频(https://www.youtube.com/watch?v=mUfJOQKdtAk)中使用很酷的新DeepFake代码,并且他们的其中一行代码遇到语法错误。下面的最小工作示例:
from modules.generator import OcclusionAwareGenerator
def load_checkpoints(config_path, checkpoint_path):
with open(config_path) as f:
config = yaml.load(f)
generator = OcclusionAwareGenerator(**config['model_params']['generator_params'],
**config['model_params']['common_params'])
generator.cuda()
它在“ generator =”行末尾的逗号中给出语法错误。
generator = OcclusionAwareGenerator(**config['model_params']['generator_params'],
^
SyntaxError: invalid syntax
我习惯于使用python 2,所以我首先想到的是那是python 3,但是老实说我不知道。如果有人知道为什么这是无效的,我会全神贯注。谢谢!
它也需要cuda,我没有,所以很遗憾,它无法在笔记本电脑上成功运行。