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

What is the input_size #72

Open
RyuShai opened this issue Jun 24, 2022 · 1 comment
Open

What is the input_size #72

RyuShai opened this issue Jun 24, 2022 · 1 comment
Assignees

Comments

@RyuShai
Copy link

RyuShai commented Jun 24, 2022

[Enter feedback here]
snipet code require create dummy input with argument "input_size". What is it, how i can find out ?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@anrahman4
Copy link

Replace dummy_input = torch.randn(1, input_size, requires_grad=True) with dummy_input = torch.randn(1, 3, 32, 32, requires_grad=True)

torch.randn is used to create a randomized tensor to feed into the model. The first parameter is the batch size, it is set to 1 here but I believe it can be set to other values as well. The second parameter is number of channels. In this tutorial, the first convolutional neural network layer has 3 channels, so it is expecting an input tensor to have the same value, and thus it is set to 3.

Lastly, the last two parameters are height and width. Since it is using images in the CIFAR10 dataset, the height and width are both 32.

If you then run the Convert_ONNX function, you should get the proper output.

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

3 participants