Skip to content

KeyError: 'module name can\'t contain "."' #13

@keenlykeenly

Description

@keenlykeenly

Hi, @tjwei when I execute the wgan2-AC-lasagne.ipynb in your repository, the following error appears:

KeyError Traceback (most recent call last)
in
----> 1 netG = DCGAN_G_nobn(imageSize, nz, nc, ngf, 1, n_extra_layers)
2 netG.apply(weights_init)

in init(self, isize, nz, nc, ngf, ngpu, n_extra_layers)
59 main = nn.Sequential()
60 main.add_module('initial.{0}-{1}.convt'.format(nz, cngf),
---> 61 nn.ConvTranspose2d(nz, cngf, 4, 1, 0, bias=False))
62 main.add_module('initial.{0}.relu'.format(cngf),
63 nn.ReLU(True))

/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py in add_module(self, name, module)
184 raise KeyError("attribute '{}' already exists".format(name))
185 elif '.' in name:
--> 186 raise KeyError("module name can't contain "."")
187 elif name == '':
188 raise KeyError("module name can't be empty string """)

KeyError: 'module name can't contain "."'

How can I solve this problom? Thanks a lot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions