Skip to content

RunTimeError: Tensor Sizes #11

@lilianaedmonds

Description

@lilianaedmonds

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions