Closed talhaanwarch closed 3 years ago
@talhaanwarch can you show how precisely you're creating this DataReader
object in your code?
In the above sample, you're passing x
to the model but I don't see where that's defined. I also don't know where densenet
is coming from. It appears you're using a plain PyTorch dataset, not the icevision Record API or the provided Dataset
object. That means you won't be able to use any of the library's models.
As for your specific error, it looks like you've used albumentations
transforms (but I see torchvision transforms in your sample above...), which only works with NumPy arrays, not PIL images
DataReader is torch custom data loader, model is PyTorch densenet model with input channel change from 3 to 1. No I am not using torchvision augmentation technique. x is just a random tensor to check whether my model is in correct or not.
I defined x as x=torch.randn(3,1,224,224)
As I am passing aug
which is albumentations function created, the self.transform
in DataReader
is this aug
function. I think this is confusing you
@talhaanwarch Maybe I'm missing something, but this does not seem to be an error related to icevision?
@lgvaz @rsomani95 I am really sorry, I have no clue, how this issue gets posted here, I was supposed to open in albumentations. Really no clue how I appear on this repo because before you mentioning icevision, I never heard it before.
albumentation version: 1.0.0
torch version: 1.9.0+cu102
code Data loader
Augmentation function
testing it
Every thing work well till here. Model initialize
run above test code again and got following error