Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
KrishnaVeer7712 opened this issue Sep 28, 2023 · 2 comments

Comments

@KrishnaVeer7712
Copy link

[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

@Lcq2002
Copy link

Lcq2002 commented Jan 15, 2024

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

@Ganesh-Malladi
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants