Skip to content

TypeError: _named_members() got an unexpected keyword argument 'remove_duplicate' #258

Open
@KrishnaVeer7712

Description

@KrishnaVeer7712

[TLX] Conv2d conv1_1: out_channels : 64 kernel_size: (3, 3) stride: (1, 1) pad: SAME act: ReLU
[TLX] Conv2d conv1_2: out_channels : 64 kernel_size: (3, 3) stride: (1, 1) pad: SAME act: ReLU
[TLX] MaxPool2d pool1: kernel_size: (2, 2) stride: (2, 2) padding: SAME return_mask: False
[TLX] Conv2d conv2_1: out_channels : 128 kernel_size: (3, 3) stride: (1, 1) pad: SAME act: ReLU
[TLX] Conv2d conv2_2: out_channels : 128 kernel_size: (3, 3) stride: (1, 1) pad: SAME act: ReLU
[TLX] MaxPool2d pool2: kernel_size: (2, 2) stride: (2, 2) padding: SAME return_mask: False
[TLX] Conv2d conv3_1: out_channels : 256 kernel_size: (3, 3) stride: (1, 1) pad: SAME act: ReLU
[TLX] Conv2d conv3_2: out_channels : 256 kernel_size: (3, 3) stride: (1, 1) pad: SAME act: ReLU
[TLX] Conv2d conv3_3: out_channels : 256 kernel_size: (3, 3) stride: (1, 1) pad: SAME act: ReLU
[TLX] Conv2d conv3_4: out_channels : 256 kernel_size: (3, 3) stride: (1, 1) pad: SAME act: ReLU
[TLX] MaxPool2d pool3: kernel_size: (2, 2) stride: (2, 2) padding: SAME return_mask: False
[TLX] Conv2d conv4_1: out_channels : 512 kernel_size: (3, 3) stride: (1, 1) pad: SAME act: ReLU
[TLX] Conv2d conv4_2: out_channels : 512 kernel_size: (3, 3) stride: (1, 1) pad: SAME act: ReLU
[TLX] Conv2d conv4_3: out_channels : 512 kernel_size: (3, 3) stride: (1, 1) pad: SAME act: ReLU
[TLX] Conv2d conv4_4: out_channels : 512 kernel_size: (3, 3) stride: (1, 1) pad: SAME act: ReLU
[TLX] MaxPool2d pool4: kernel_size: (2, 2) stride: (2, 2) padding: SAME return_mask: False
[TLX] Restore pre-trained weights
[TLX] Loading (3, 3, 3, 64) in conv1_1
[TLX] Loading (64,) in conv1_1
Traceback (most recent call last):
File "train.py", line 113, in
VGG = vgg.VGG19(pretrained=True, end_with='pool4', mode='dynamic')
File "D:\E\MtechDAIICT\Sem3\ComputerVision\Project\SRGAN\vgg.py", line 261, in vgg19
restore_model(model, layer_type='vgg19')
File "D:\E\MtechDAIICT\Sem3\ComputerVision\Project\SRGAN\vgg.py", line 175, in restore_model
if len(model.all_weights) == len(weights1):
File "D:\E\anaconda\envs\opencv-env2\lib\site-packages\tensorlayerx\nn\core\core_torch.py", line 149, in all_weights
for name, param in self.named_parameters(recurse=True):
File "D:\E\anaconda\envs\opencv-env2\lib\site-packages\torch\nn\modules\module.py", line 2112, in named_parameters
gen = self._named_members(
TypeError: _named_members() got an unexpected keyword argument 'remove_duplicate'

I had also installed vgg.19.npy file manually.

Could you please help me?
Thanks, very much!
@zsdonghao

Activity

Lcq2002

Lcq2002 commented on Jan 15, 2024

@Lcq2002

I had the same problem, have you solved it yet?

Ganesh-Malladi

Ganesh-Malladi commented on Jan 17, 2024

@Ganesh-Malladi

If you have downloaded Tensorflow model weights, change the backend to tensorflow backend.
os.environ['TL_BACKEND'] = 'tensorflow'
By default it is set to torch in train.py file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @KrishnaVeer7712@Lcq2002@Ganesh-Malladi

        Issue actions

          TypeError: _named_members() got an unexpected keyword argument 'remove_duplicate' · Issue #258 · tensorlayer/SRGAN