Skip to content

ConvertWeights Error #4

@jmxz994

Description

@jmxz994

Hi, I copied your source and ran it in the root directory: python convert_weights.py --cfg configs\swin_tiny_patch4_window7_224.yaml --weights torch_weights\swin_tiny_ patch4_window7_224.pth --weights_type imagenet_1k --output tf_weights .
The error is reported as follows:
**tensorflow.python.framework.errors_impl.UnimplementedError: Exception encountered when calling layer 'conv2d' (type Conv2D).

{{function_node _wrapped__Conv2D_device/job:localhost/replica:0/task:0/device:CPU:0}} The Conv2D op currently only supports the NHWC The Conv2D op currently only supports the NHWC tensor format on the CPU. The op was given the format: NCHW [Op:Conv2D]

Call arguments received by layer 'conv2d' (type Conv2D): inputs=tf.

  • inputs=tf.Tensor(shape=(1, 3, 224, 224), dtype=float32)**

I think it has something to do with the Conv2d differences between Torch and TF, but no amount of fine-tuning on my part will fix it.

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

    Issue actions