Skip to content

train error /KeyError: 'module name can\'t contain ".", got: layer2.leakyrelu' #64

@gyx-tail

Description

@gyx-tail

When I run the train.py,show this
Traceback (most recent call last):
File "train.py", line 118, in
netG = net.dehaze(inputChannelSize, outputChannelSize, ngf)
File "/mnt/e/PycharmProject/DCPDN-master/models/dehaze22.py", line 665, in init
self.tran_est=G(input_nc=3,output_nc=3, nf=64)
File "/mnt/e/PycharmProject/DCPDN-master/models/dehaze22.py", line 216, in init
layer2 = blockUNet(nf, nf*2, name, transposed=False, bn=True, relu=False, dropout=False)
File "/mnt/e/PycharmProject/DCPDN-master/models/dehaze22.py", line 56, in blockUNet
block.add_module('%s.leakyrelu' % name, nn.LeakyReLU(0.2, inplace=True))
File "/home/gyx1999/anaconda3/envs/pytorchgpu/lib/python3.8/site-packages/torch/nn/modules/module.py", line 380, in add_module
raise KeyError("module name can't contain ".", got: {}".format(name))
KeyError: 'module name can't contain ".", got: layer2.leakyrelu'
How can I solve this problem

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