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

RunTimeError: Tensor Sizes #11

Open
lilianaedmonds opened this issue Jan 30, 2024 · 0 comments
Open

RunTimeError: Tensor Sizes #11

lilianaedmonds opened this issue Jan 30, 2024 · 0 comments

Comments

@lilianaedmonds
Copy link

I am trying to train StarSRGAN by following all the instructions on the README file so that I can eventually train it using my own dataset for research. I am using images from DIV2K and have my meta_info.txt file, but I did not perform the optional steps to generate multiscale/cropped images. However, when I try to train with a single GPU in debug mode (python starsrgan/train.py -opt options/train_starsrnet.yml --debug), I get the following error about tensor size:

RuntimeError: The expanded size of the tensor (16) must match the existing size (128) at non-singleton dimension 0. Target sizes: [16, 1]. Tensor sizes: [128, 1]

Which is coming from:


self.degradation_params[:, self.road_map[0] : self.road_map[0] + 1] = (data["kernel1"]["kernel_size"].unsqueeze(1) - kernel_size_range1[0]
                ) / (kernel_size_range1[1] - kernel_size_range1[0])

since self.degradation_params[:, self.road_map[0] : self.road_map[0] + 1] is of size [16,1] and (data["kernel1"]["kernel_size"].unsqueeze(1) - kernel_size_range1[0]) / (kernel_size_range1[1] - kernel_size_range1[0]) is of size [128,1].

Has anyone had this issue and resolved it/have any idea what may be causing this? Any help is appreciated.

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

1 participant