【问题标题】:Implementation of StyleGAN by NVlabs shows syntax errorNVlabs 实现 StyleGAN 显示语法错误
【发布时间】:2019-07-23 07:56:55
【问题描述】:

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

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

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

【问题讨论】:

    标签: python python-3.x syntax-error generative-adversarial-network


    【解决方案1】:

    它叫type annotations,是在Python3.6中引入的。

    此 PEP 旨在为 Python 添加语法以注释类型 变量(包括类变量和实例变量),而不是 通过 cmets 表达它们:

    primes: List[int] = []
    
    captain: str  # Note: no initial value!
    
    class Starship:
        stats: ClassVar[Dict[str, int]] = {}
    

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

    • 64 位 Python 3.6 安装。我们推荐使用 numpy 1.14.3 或更高版本的 Anaconda3。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-04-12
      • 1970-01-01
      • 1970-01-01
      • 2020-01-04
      • 1970-01-01
      • 2012-10-05
      • 2016-12-16
      相关资源
      最近更新 更多