'PixelShuffle_ICNR' object has no attribute 'do_blur' on binary segmentation prediction

I trained a binary segmentation, and I exported the pickle model.
When I load the learner and trying to predict

model = load_learner(path=path_to_models_dir, file=model_name)
x, y, pred, raw_pred=model.predict(img,return_x=True)

I get this error:

File "C:\Anaconda3\envs\deeplearning\lib\site-packages\fastai\basic_train.py", line 375, in predict
        res = self.pred_batch(batch=batch, with_dropout=with_dropout)
      File "C:\Anaconda3\envs\deeplearning\lib\site-packages\fastai\basic_train.py", line 354, in pred_batch
        if not with_dropout: preds = loss_batch(self.model.eval(), xb, yb, cb_handler=cb_handler)
      File "C:\Anaconda3\envs\deeplearning\lib\site-packages\fastai\basic_train.py", line 26, in loss_batch
        out = model(*xb)
      File "C:\Anaconda3\envs\deeplearning\lib\site-packages\torch\nn\modules\module.py", line 547, in __call__
        result = self.forward(*input, **kwargs)
      File "C:\Anaconda3\envs\deeplearning\lib\site-packages\fastai\layers.py", line 136, in forward
        nres = l(res)
      File "C:\Anaconda3\envs\deeplearning\lib\site-packages\torch\nn\modules\module.py", line 547, in __call__
        result = self.forward(*input, **kwargs)
      File "C:\Anaconda3\envs\deeplearning\lib\site-packages\fastai\vision\models\unet.py", line 29, in forward
        up_out = self.shuf(up_in)
      File "C:\Anaconda3\envs\deeplearning\lib\site-packages\torch\nn\modules\module.py", line 547, in __call__
        result = self.forward(*input, **kwargs)
      File "C:\Anaconda3\envs\deeplearning\lib\site-packages\fastai\layers.py", line 219, in forward
        return self.blur(self.pad(x)) if self.do_blur else x
      File "C:\Anaconda3\envs\deeplearning\lib\site-packages\torch\nn\modules\module.py", line 591, in __getattr__
        type(self).__name__, name))
    AttributeError: 'PixelShuffle_ICNR' object has no attribute 'do_blur'
    ] name: 'AttributeError' }

Can you help me resolve it?

I found the solution. I downgraded fastai version from 1.0.57 to 1.0.55 and it’s work.

1 Like

I am having the same problem. My setup is as follows:

=== Software === 
python        : 3.6.8
fastai        : 1.0.57
fastprogress  : 0.1.21
torch         : 1.2.0.dev20190622
nvidia driver : 418.56
torch cuda    : 10.0.130 / is available
torch cudnn   : 7501 / is enabled

change your fastai version to from 1.0.57 to 1.0.55.
I think it will work !


Thanks for your reply. I have checked the 1.0.55. It works, but I need to use 1.0.57 because of this pull request where activ is a parameter in the get_preds function

How to downgrade fastai back to 1.0.55 ?

Please ignore my comments, its simple :
!pip install fastai==1.0.55

did anybody find a solution without having to downgrade to 1.0.55?

did you figure out how to do it?

For my need 1.0.55 work well so I did not try to do it without.