NVlabs 实施 StyleGAN 显示语法错误

Implementation of StyleGAN by NVlabs shows syntax error

我试图在我的本地系统上实现 StyleGAN,但无法 运行,因为 __init__.py 中的 语法无效 文件。

submit_config: SubmitConfig = None # Package level variable for SubmitConfig which is only valid when inside the run function.

这一行是在所有导入之后,我不确定是否必须更改官方代码或者是否缺少依赖项。 __init__.py 文件可以在 here.

中找到

它被称为 type annotations 并在 Python3.6.

中引入

This PEP aims at adding syntax to Python for annotating the types of variables (including class variables and instance variables), instead of expressing them through comments:

primes: List[int] = []

captain: str  # Note: no initial value!

class Starship:
    stats: ClassVar[Dict[str, int]] = {}

StyleGAN System Requirements 确实提到他们需要 Python3.6 安装。

  • 64-bit Python 3.6 installation. We recommend Anaconda3 with numpy 1.14.3 or newer.