Satellite Imagery Error- TypeError: 'str' object is not callable

While implementing the Satellite Imagery [01:53:01] from the notebook

I got the below error for the line
learn = ConvLearner.pretrained(‘resnet34’, data=data, metrics=metrics)

I verified the parameters data and metrics and they are all good. Even removing the last parameter metrics gave the same error.

TypeError: ‘str’ object is not callable

Detailed Error

TypeError Traceback (most recent call last)
in ()
----> 1 learn = ConvLearner.pretrained(‘resnet34’, data=data64ReSize)

/usr/local/lib/python3.6/dist-packages/fastai/ in pretrained(cls, f, data, ps, xtra_fc, xtra_cut, custom_head, precompute, pretrained, **kwargs)
111 pretrained=True, **kwargs):
112 models = ConvnetBuilder(f, data.c, data.is_multi, data.is_reg,
–> 113 ps=ps, xtra_fc=xtra_fc, xtra_cut=xtra_cut, custom_head=custom_head, pretrained=pretrained)
114 return cls(data, models, precompute, **kwargs)

/usr/local/lib/python3.6/dist-packages/fastai/ in init(self, f, c, is_multi, is_reg, ps, xtra_fc, xtra_cut, custom_head, pretrained)
38 else: cut,self.lr_cut = 0,0
39 cut-=xtra_cut
—> 40 layers = cut_model(f(pretrained), cut)
41 = model_features[f] if f in model_features else (num_features(layers)*2)
42 if not custom_head: layers += [AdaptiveConcatPool2d(), Flatten()]

TypeError: ‘str’ object is not callable

Hi friend,
Not sure if you have the solution already. If you’re still having trouble, try

from fastai.conv_learner import *
arch = resnet34 #This is strictly not a string.

learn = ConvLearner.pretrained(arch, data=data64ReSize)

I haven’t tested it though. But should work.

Happy learning!