PistonY / torch-toolbox

🛠 Toolbox to extend PyTorch functionalities
BSD 3-Clause "New" or "Revised" License
416 stars 56 forks source link

Cannot import 'ImageNetPolicy' #12

Closed rljahn closed 2 months ago

rljahn commented 3 years ago

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.

PistonY commented 3 years ago

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

rljahn commented 3 years ago

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

image

PistonY commented 3 years ago

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.