Unavailable instructions PyTorch CPU

Hi Guys, I’m trying to run MobileNetv3 on pytorch (1.4.0+cpu and 1.5.0+cpu), but I’m getting the error
AttributeError: 'SelectAdaptivePool2d' object has no attribute 'flatten'.

Is this just an unavailable instruction for PyTorch CPU or am I doing something wrong? If so, is there any comprehensive list that shows which models do and don’t run on the cpu?

I assume you are using @rwightman’s implementation of this model?
If so, note that the flatten argument seems to have been added 13 days ago here.
Are you using different versions of the repository?

1 Like

That woud appear to be my impl. Unexpected error, especially given that the default remained to not flatten when that was added. A lot of GPU usage with that change in and no problems noticed.

@Bauke_Brenninkmeijer I just ran on a clean environement, PyTorch 1.5.0 cpu (conda) and no such issue. Any chance you’ve got multiple PyTorch or timm versions in the environment/path? It wasn’t long ago that flatten didn’t exist in PyTorch.

1 Like

@rwightman Thanks for the fast response. I’ll create a new environment and see if it makes a difference. I’ll report back.

Aaah I got the issue. I was running an old version of timm in the environment where I exported and a new version of timm in the environment where it was imported. Hence the exported model did not have the .flatten attribute.

Again, thanks for the help! Sorry for not updating first :).