What is the difference between the kernels of kaggle and googlecolab?

username: 111555
cooked: <p>I fell in love with machine learning, the sun.<br>
I have one question.<br>
Why is it that I can run it in kaggle’s kernel, but not in googlecolab?<br>
I don’t know how to make it work.<br>
Please help me.</p>
<aside class="onebox allowlistedgeneric" data-onebox-src="https://www.kaggle.com/yasufuminakama/g2net-efficientnet-b7-baseline-training?scriptVersionId=69947710">
  <header class="source">
      <img src="https://www.kaggle.com/static/images/favicon.ico" class="site-icon" width="32" height="32">

      <a href="https://www.kaggle.com/yasufuminakama/g2net-efficientnet-b7-baseline-training?scriptVersionId=69947710" target="_blank" rel="noopener nofollow ugc">kaggle.com</a>
  </header>

  <article class="onebox-body">
    <img width="100" height="100" src="https://storage.googleapis.com/kaggle-avatars/thumbnails/1695531-kg.jpeg" class="thumbnail onebox-avatar">

<h3><a href="https://www.kaggle.com/yasufuminakama/g2net-efficientnet-b7-baseline-training?scriptVersionId=69947710" target="_blank" rel="noopener nofollow ugc">G2Net / efficientnet_b7 / baseline [training]</a></h3>

  <p>Explore and run machine learning code with Kaggle Notebooks | Using data from multiple data sources</p>


  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>
<p>
By the way, I am using timm’s efficientnet.<br>
![file:///Users/SN/Pictures/Screenshot_2021-08-22%2013.36.07_QLL1wr.png](url to embed)</p>
<blockquote>
<h2>CQT kernels created, time used = 0.0308 seconds<br>
/usr/local/lib/python3.7/dist-packages/nnAudio/utils.py:326: SyntaxWarning: If fmax is given, n_bins will be ignored<br>
warnings.warn(‘If fmax is given, n_bins will be ignored’,SyntaxWarning)</h2>
<p>ValueError                                Traceback (most recent call last)<br>
 in ()<br>
4<br>
5     plt.figure(figsize=(16,12))<br>
----&gt; 6     image, label = train_dataset[i]<br>
7<br>
8     plt.imshow(image[0])</p>
<p>4 frames<br>
/usr/local/lib/python3.7/dist-packages/albumentations/pytorch/transforms.py in apply(self, img, **params)<br>
90<br>
91     def apply(self, img, **params):  # skipcq: PYL-W0613<br>
—&gt; 92         return torch.from_numpy(img.transpose(2, 0, 1))<br>
93<br>
94     def apply_to_mask(self, mask, **params):  # skipcq: PYL-W0613</p>
<p>ValueError: axes don’t match array</p>
</blockquote>

username: ptrblck
cooked: <p>Based on the error message numpy isn’t able to <code>transpose</code> the numpy array, which might happen e.g. if you are now loading grayscale images (and were loading RGB images previously), so you would have to make sure the same image format is used in both setups.</p>

username: 111555
cooked: <p>This post was flagged by the community and is temporarily hidden.</p>
cooked_hidden: yes
hidden_reason_id: 3

username: 111555
cooked: <blockquote>
<h1>====================================================</h1>
<h1>Transforms</h1>
<h1>====================================================</h1>
<p>def get_transforms(*, data):</p>
<pre><code>if data == 'train':
    return A.Compose([
        ToTensorV2(),
    ])

elif data == 'valid':
    return A.Compose([
        ToTensorV2(),
    ])
</code></pre>
</blockquote>
<p>Is there a solution to this that would use this? I’m really sorry for the late reply.</p>

username: 111555
cooked: <p>If you add the above transform, you can do it in kaggle eda, but not in googlecolab.<br>
Without it, it is possible.</p>