Hey Gods of fastai,
I’ve made it - thanks to some great members here - to finally load the data, find the missing files, and now I’m ready to run the trainning.
But now, I got this error: “add_tfms”. What does it mean?
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-12-64fc6a634eaa> in <module>()
----> 1 learn = cnn_learner(dls, resnet18, n_out=1, pretrained=True,loss_func=L1LossFlat, metrics=accuracy)
3 frames
/usr/local/lib/python3.7/dist-packages/fastai/vision/learner.py in cnn_learner(dls, arch, normalize, n_out, pretrained, config, loss_func, opt_func, lr, splitter, cbs, metrics, path, model_dir, wd, wd_bn_bias, train_bn, moms, **kwargs)
172
173 meta = model_meta.get(arch, _default_meta)
--> 174 if normalize: _add_norm(dls, meta, pretrained)
175
176 if n_out is None: n_out = get_c(dls)
/usr/local/lib/python3.7/dist-packages/fastai/vision/learner.py in _add_norm(dls, meta, pretrained)
155 stats = meta.get('stats')
156 if stats is None: return
--> 157 dls.add_tfms([Normalize.from_stats(*stats)],'after_batch')
158
159 # Cell
/usr/local/lib/python3.7/dist-packages/fastai/data/core.py in __getattr__(self, k)
334 return res if is_indexer(it) else list(zip(*res))
335
--> 336 def __getattr__(self,k): return gather_attrs(self, k, 'tls')
337 def __dir__(self): return super().__dir__() + gather_attr_names(self, 'tls')
338 def __len__(self): return len(self.tls[0])
/usr/local/lib/python3.7/dist-packages/fastcore/transform.py in gather_attrs(o, k, nm)
163 att = getattr(o,nm)
164 res = [t for t in att.attrgot(k) if t is not None]
--> 165 if not res: raise AttributeError(k)
166 return res[0] if len(res)==1 else L(res)
167
AttributeError: add_tfms
Thing is, I don’t need much to make transformations of the data. It’s simple a GAN as it’s supposed to look here:
Plus, this is the code I’m working on: