Only batches of spatial targets supported error
Hello, I was following Fine-Tune a Semantic Segmentation Model with a Custom Dataset with my own dataset. In train.train() it gave me this error “only batches of spatial targets supported (3D tensors) but got targets of size: : [32, 512, 512, 3]”. I followed every steps from tutorial. how can I solve this?
2023-02-07T08:01:24Z
Faced the same thing today. Did you resolve it by any chance?P.S. for adding more context to the question, I was following this guidetransformers/examples/pytorch/semantic-segmentation at main · huggingface/transformers · GitHub
2023-03-08T15:25:37Z
I had this problem too. To solve it i had to transform my mask images to grayscale, in order to delete the last dimention of the target array. Hope this helps!