Hello.
I’m trying to tweak things from the lecture little bit, and now working on having the Resnet without the pre-trained weights.
So after copying and pasting all the Resnet-related codes from master library, I attempted the following:
arch = resnet152
learn = ConvLearner.from_model_data(resnet152, data)
As you can see, I put .from_model_data instead of .pretrained, and got this error.
AttributeError Traceback (most recent call last)
in
----> 1 learn = ConvLearner.from_model_data(resnet152, data)~\fastai\courses\dl1\fastai\learner.py in from_model_data(cls, m, data, **kwargs)
42 @classmethod
43 def from_model_data(cls, m, data, **kwargs):
—> 44 self = cls(data, BasicModel(to_gpu(m)), **kwargs)
45 self.unfreeze()
46 return self~\fastai\courses\dl1\fastai\core.py in to_gpu(x, *args, **kwargs)
88 def to_gpu(x, *args, **kwargs):
89 ‘’‘puts pytorch variable to gpu, if cuda is available and USE_GPU is set to true. ‘’’
—> 90 return x.cuda(*args, **kwargs) if USE_GPU else x
91
92 def noop(*args, **kwargs): returnAttributeError: ‘function’ object has no attribute ‘cuda’
Does anyone know how to deal with this issue? Seems like the ‘function’ and ‘cuda’ problem, but my CUDA is working just fine and I don’t know where that ‘function’ comes from.
Any help is appreciated.