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

No Support for FastRCNN Based Models #87

Open
RoyiAvital opened this issue Mar 21, 2023 · 4 comments
Open

No Support for FastRCNN Based Models #87

RoyiAvital opened this issue Mar 21, 2023 · 4 comments

Comments

@RoyiAvital
Copy link

Describe the bug
FastRCNN based models input is a list (The batch is a list of tensors).
Hence it can not be described using the current API which only let the user set the tensor dimensions.

To Reproduce

  1. Build the FastRCNN model:
model = torchvision.models.detection.fasterrcnn_resnet50_fpn(weights=FasterRCNN_ResNet50_FPN_Weights.DEFAULT)
# For inference
model.eval()
x = [torch.rand(3, 300, 400), torch.rand(3, 500, 400)]
predictions = model(x)
  1. The input can not be described using the input size API.

Expected behavior
Being able to set the input using a specific example.

@mert-kurttutan
Copy link
Owner

Thanks for the report!
It turns out model gives another error when using input_data API. The problem for this is because torchvision uses Imagelist object when return tensor from modules. As of now, torchview covers iterable, mappable objects, which ImageList is not.

Relevant piece of code: https://github.com/pytorch/vision/blob/6ca9c76adb6daf2695d603ad623a9cf1c4f4806f/torchvision/models/detection/generalized_rcnn.py#L83

My first attempt at solving this would be to iterate of attributes of output and input objects in order to cover all the objects, not just iterable and mappable ones.

@mert-kurttutan
Copy link
Owner

I will try a few solutions and inform you when a relevant update is complete

@RoyiAvital
Copy link
Author

RoyiAvital commented Mar 23, 2023

Great!

By the way, wrote about your package at StackExchange - Data Science - How Do You Visualize Neural Network Architectures.

@mert-kurttutan
Copy link
Owner

Thanks for spreading the word :)

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