Closed ym820 closed 1 year ago
Fixed. It seems like the order of the transforms matters
Hello @akai820 Can you tell me more about how you solve this?
Hello @akai820 Can you tell me more about how you solve this?
From the example they provided, they put the transforms from pytorch at the end of the pipeline (https://docs.ffcv.io/ffcv_examples/cifar10.html), so I just tried to put these two T.ColorJitter(brightness=.5, hue=.3), T.Grayscale()
at the end and it worked.
All right @akai820
I had this problem too:
<source missing, REPL/exec in use?>
But in my case I was using a NDArrayField
field to encode a numpy array with dtype: float16
, and when I decoded this with NDArrayDecoder
it didn't works.
So, to solve my problem, i just consider the dtype of the numpy array as float32
instead of float16
, and it works!
I know this is closed, but just so what happened here is fully clear to you:
The image loader, before any pipeline operations, returns numpy arrays in BGR color channel format. That's why the vast majority of examples and applications will use ToTensor() -> ToTorchImage() in the pipeline (ToTorchImage, among other things, performs a BGR -> RGB conversion). If you're using a torchvision transform which expects an RGB format tensor, you'd have to place it after ToTensor() and ToTorchImage(). But maybe in the future you'll want to use some custom transform that operates on a numpy BGR array, or a BGR tensor; then you would put that transform between ToTensor and ToTorchImage, or before ToTensor, respectively.
Hi, I am new to using ffcv as the dataloader and I wondered how I could apply functions in
torchvision.transforms
(e.g. ColorJitter or Grayscale) in the pipeline for data augmentation? I got errors like the below and am not sure how to solve them. Thanks!My code:
The error message: