qubvel / segmentation_models.pytorch

Segmentation models with pretrained backbones. PyTorch.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

data preproccessing : mask = to_tensor

raidanis opened this issue · comments

my masks shape is (512, 512), when i start the fitting i get an error of miss matching axes , i think the problem is here :

**def to_tensor(x, **kwargs):

return x.transpose(2, 0, 1).astype('float32')**

the function expect input of 3 dimentions not 2 , any one can help ??

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

Hi, you can just expand the last dim, x[..., None]

You can ask a question, if I have an answer I will help :)