Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

single gpu train #9

Open
wmrenr opened this issue Jun 9, 2022 · 4 comments
Open

single gpu train #9

wmrenr opened this issue Jun 9, 2022 · 4 comments

Comments

@wmrenr
Copy link

wmrenr commented Jun 9, 2022

when I use single GPU to train VOC datasets ,I got an error:
image

can you help me?

@wmrenr
Copy link
Author

wmrenr commented Jun 9, 2022

I print torch.from_numpy(labels_cmap).shape :[512,512,3] and the 3D transpose should be performed, so I cant understand '.permute([0, 3, 1, 2])' in your codes.

@HenryQUQ
Copy link

I print torch.from_numpy(labels_cmap).shape :[512,512,3] and the 3D transpose should be performed, so I cant understand '.permute([0, 3, 1, 2])' in your codes.

torch.from_numpy(labels_cmap).shape should be [1,512,512,3] because it is followed the RGB rule, and after permuting, it will turn the default tensor form [1,3,512,512].

The result why your issue happens is you read only one image each time, so the shape will be (512, 512, 3). You can simply add '.unsqueeze(0)' after ' torch.from_numpy(labels_cmap)'. This line should be 'torch.from_numpy(labels_cmap).unsqueeze(0).permute([0, 3, 1, 2])

@llttisme
Copy link

llttisme commented Jul 2, 2023

Excuse me, can it run successfully on a single GPU?

@yxsec
Copy link

yxsec commented Oct 28, 2023

Excuse me, can it run successfully on a single GPU?

Hi, have you solved it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants