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

MCT fails on torch.nn.functional.layer_norm #921

Closed
Idan-BenAmi opened this issue Jan 9, 2024 · 1 comment
Closed

MCT fails on torch.nn.functional.layer_norm #921

Idan-BenAmi opened this issue Jan 9, 2024 · 1 comment
Assignees

Comments

@Idan-BenAmi
Copy link
Collaborator

Issue Type

Bug

Source

source

MCT Version

1.10.0

OS Platform and Distribution

No response

Python version

No response

Describe the issue

Model that includes layer_norm() raises the following MCT error:
TypeError: layer_norm(): argument 'normalized_shape' (position 2) must be tuple of ints, not Parameter

Expected behaviour

No response

Code to reproduce the issue

model_optimization/tutorials/quick_start/main.py --model_name pvt_v2_b2 --model_library timm --validation_dataset_folder <> --representative_dataset_folder <> --validation_set_limit 100

Log output

File "./venv_np_1_26/lib/python3.11/site-packages/torch/nn/functional.py", line 2515, in layer_norm
    return torch.layer_norm(input, normalized_shape, weight, bias, eps, torch.backends.cudnn.enabled)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: layer_norm(): argument 'normalized_shape' (position 2) must be tuple of ints, not Parameter
@Idan-BenAmi
Copy link
Collaborator Author

Issue was resolved in #923 - we replace functional layer_norm with nn.LayerNorm

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

2 participants