question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UnimplementedError: The Conv2D op currently does not support grouped convolutions on the CPU.

See original GitHub issue

Info

Coalb TPU v2
Kaggle TPU v3
TensorFlow: 2.4.1
Transformer: 4.22.0.dev0

Who can help?

@Rocketknight1 @NielsRogge @sgugger @amyeroberts

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, …)
  • My own task or dataset (give details below)

Reproduction

Please, get the file form HERE. A notebook scripts, just plug-n-play.

What to do

  1. Run the script in Colab with TPU.
  2. Run the script in Kaggle with TPU.

You may not need to change anything, just through the file to these platform and run all.

Expected behavior

What was I doing

With the given script above, I was trying to run a vision transformer model on Kaggle TPU (with TF 2.4.1 by default). And I got

      2     prime_input = tf.keras.Input(shape=(*IMAGE_SIZE, 3))
      3     mode_inputs = tf.keras.layers.Permute(dims=(3, 1, 2))(prime_input)
----> 4     backbone = TFConvNextModel.from_pretrained("facebook/convnext-tiny-224")
      5     backbone.trainable = False
....
    171     def call(self, hidden_states, training=False):
    172         input = hidden_states
--> 173         x = self.dwconv(hidden_states)
    174         x = self.layernorm(x)
    175         x = self.pwconv1(x)

UnimplementedError: The Conv2D op currently does not support grouped convolutions on the CPU. A grouped convolution was attempted to be run because the input depth of 96 does not match the filter input depth of 1

A known tf issue, discussed also here. But this issue didn’t appear when I ran the same script on Colab TPU (with tf 2.4.1) system. The model build successfully.

As I am currently using transformer on kaggle platform, I need to make it work. The given script above is just about model construction code. Any pointer what’s going on here?

Please note again, Kaggle TPU v3 and Colab TPU v2. Not sure if it’s something to do with this.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
github-actions[bot]commented, Sep 28, 2022

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

0reactions
gantecommented, Sep 28, 2022

Hi @innat – as I’ve mentioned above this is an issue for the Kaggle and/or the TensorFlow team, there is nothing the transformers team can do.

We don’t have the power to go back in time and add code to a repository that isn’t ours, nor to update Kaggle’s TPU runtimes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Conv2D op currently does not support grouped ...
UnimplementedError: The Conv2D op currently does not support grouped convolutions on the CPU. which is a known issue but if it's the main ......
Read more >
Fused conv implementation does not support grouped ...
I had a similar error, the problem was with the number of channels for my image and the number of channels I specified...
Read more >
Error message for grouped convolution backprop on CPU is ...
Hello, I recently learned that gradients and backprop for grouped convolution is not supported on CPU, as discussed in the following github ...
Read more >
Fused conv implementation does not support grouped ...
UnimplementedError : Fused conv implementation does not support grouped ... Dataset.map()报错The Conv2D op currently only supports the NHWC ...
Read more >
2 Errors when trying to run a CNN with TF/Keras - Reddit
"Fused conv implementation does not support grouped convolutions for now." I am using slightly modified code that I used for another CNN ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found