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

Larger input size #5

Closed
muminoff opened this issue Jan 22, 2020 · 4 comments
Closed

Larger input size #5

muminoff opened this issue Jan 22, 2020 · 4 comments

Comments

@muminoff
Copy link

muminoff commented Jan 22, 2020

Can you show us a quick way how to customize the network to use larger input size?
I am willing to test it with 1024x1024 size.

@sdsubhajitdas
Copy link
Owner

In the bts package inside dataset.py you can see the TumorDataset class.
Inside TumorDataset's constructor you can see there are some default transformations

self.default_transformation = transforms.Compose([
            transforms.Grayscale(),
            transforms.Resize((512, 512))
        ])

You can change the Resize transformation size

self.default_transformation = transforms.Compose([
            transforms.Grayscale(),
            transforms.Resize((1024, 1024))
        ])

I think this will do the trick. After creating the model you can call the summary function on the model object the input size parameter u want. That will show you the sizes in each step.

Inside model.py DynamicUNet class.

def summary(self, input_size=(1, 512, 512), batch_size=-1, device='cuda'):
        """ Get the summary of the network in a chart like form
        with name of layer size of the inputs and parameters 
        and some extra memory details.
        This method uses the torchsummary package.
        For more information check the link.
        Link :- https://github.com/sksq96/pytorch-summary
        Parameters:
            input_size(tuple): Size of the input for the network in
                                 format (Channel, Width, Height).
                                 Default: (1,512,512)
            batch_size(int): Batch size for the network.
                                Default: -1
            device(str): Device on which the network is loaded.
                            Device can be 'cuda' or 'cpu'.
                            Default: 'cuda'
        Returns:
            A printed output for IPython Notebooks.
            Table with 3 columns for Layer Name, Input Size and Parameters.
            torchsummary.summary() method is used.
        """

@sdsubhajitdas
Copy link
Owner

Let me know if this works.

@muminoff
Copy link
Author

muminoff commented Feb 7, 2020

@sdsubhajitdas Thanks for the detailed info and apologizes for late response.

How about training process?
Can you suggest how to do it?
There is no instruction on readme.
AFAIK api.py file only provides prediction operation.

@muminoff
Copy link
Author

muminoff commented Feb 7, 2020

Never mind. Just discovered it in notebook.

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

2 participants