[FIXED] ERROR: Set_meta() got an unexpected keyword argument 'as_copy'

I noticed an issue a few days ago that I logged into Github. It seems other users are facing the same issue as well.
I’ve used a workaround that seems to work. If you are interested please take a look at this.

Edit: this error has now been fixed as part of fastai 2.0.19.

1 Like

The issue can be described as:

Fastai doesn’t pin the fastcore version each one uses. As a result it will install the most recent version all the time. I’ve gone ahead and asked Jeremy what the best approach to fix this is, as the fix is to look at the release of fastai you are working on, and the releases of fastcore (through the pypi website) and find the version to install through the date.

For example if my fastai version was 2.0.16, I would look for the fastcore version released around October 8th, which would be 1.1.0. (This is a MVP for the versioning, there could be compatible fastcore versions above that, but this is guaranteed to get your version working)

pypi for fastai and fastcore

2 Likes

After some discussion w/ Jeremy in the future versions of fastcore will be pinned if breaking changes are done to avoid this :slight_smile: for now use my/@oguiza‘s solutions but in the future this shouldn’t be an issue anymore.

1 Like

I am having this problem even though I have installed the latest version of fastai in Colab.
In particular, I did:
pip install --upgrade fastai
import fastai
fastai.__ version __
2.0.19

and I still get the same error. Am I missing something?

1 Like

Hi,

Just now I have started learning the “Deep Learning”, and got the same error
followed most the comments, but still the same.

Below are the details:

  • using google colab
  • fastai : 2.1.2
  • fastcore: 1.3.1
  • torch : 1.7.0
path = untar_data(URLs.PETS)/'images'

def is_cat(x):
  return x[0].isupper()

dls = ImageDataLoaders.from_name_func(path,
                                      get_image_files(path),
                                      valid_pct= 0.2,
                                      seed= 42,
                                      label_func= is_cat,
                                      item_tfms= Resize(224))

learn = cnn_learner(dls, resnet34, metrics= error_rate)
learn.fine_tune(1)

Any suggestion…

May be an outdated torch. Just ran on colab just fine.

  1. !pip install fastai -U >> /dev/null
  2. Restart runtime (not reset)
  3. Run your same code:
from fastai.vision.all import *
path = untar_data(URLs.PETS)/'images'

def is_cat(x):
  return x[0].isupper()

dls = ImageDataLoaders.from_name_func(path,
                                      get_image_files(path),
                                      valid_pct= 0.2,
                                      seed= 42,
                                      label_func= is_cat,
                                      item_tfms= Resize(224))

learn = cnn_learner(dls, resnet34, metrics= error_rate)
learn.fine_tune(1)
1 Like

@muellerzr Many thanks for the prompt reply. now it’s working :slightly_smiling_face: