torch-toolbox icon indicating copy to clipboard operation
torch-toolbox copied to clipboard

Cannot import 'ImageNetPolicy'

Open rljahn opened this issue 4 years ago • 3 comments

Hi, I am new to the package. I want to use the ImageNetPolicy as one of the data transformation by

from torchtoolbox.transform import ImageNetPolicy

But shows:

ImportError: cannot import name 'ImageNetPolicy'

How can I solve this? Thanks.

rljahn avatar Jan 08 '21 09:01 rljahn

Hi, try use this: from torchtoolbox.transform.autoaugment import ImageNetPolicy

PistonY avatar Jan 11 '21 02:01 PistonY

Hi, I still cannot find it from the torchtoolbox folder. It seems like it's not registered (?)

image

rljahn avatar Jan 11 '21 10:01 rljahn

I don't put ImageNetPolicy into __init__ of transform. So you need to import it from autoaugment module. I've tried this way work for me.

from torchtoolbox.transform.autoaugment import ImageNetPolicy

If you still can not import this, please tell me your version of toolbox.

PistonY avatar Jan 12 '21 02:01 PistonY