I am trying to import the class BasicBlock from torchvision.models.resnet by doing this
from torchvision.models.resnet import *
It is giving no error but when I am trying to use BasicBlock class in my code (which is supposed to be imported already), I am getting the error that
NameError: name 'BasicBlock' is not defined
even though BasicBlock is present in torchvision.models.resnet
But it gives no error when I import like this
from torchvision.models.resnet import BasicBlock
and then use it in my code
Why am I getting this error?