【error】AttributeError: cannot assign module before Module.__init__() call


【error】在初始化函数调用前不能分配模块


原因:

调用了自定义的类,但是 在自定义的类的__init__函数下面没有写super( XXX, self ).__init__() 

class XXX( nn.Module ):
    def __init__(self, 等等):
        super( XXX, self ).__init__() 

猜你喜欢

转载自blog.csdn.net/ccbrid/article/details/81000424