Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Add required dependencies error message to available_* methods. #1125

Closed
martin0258 opened this issue Jan 19, 2022 · 3 comments · Fixed by #1148
Closed

Add required dependencies error message to available_* methods. #1125

martin0258 opened this issue Jan 19, 2022 · 3 comments · Fixed by #1148
Labels
bug / fix Something isn't working help wanted Extra attention is needed
Milestone

Comments

@martin0258
Copy link

🐛 Bug

To Reproduce

Code to reproduce the behavior:

from flash.image import KeypointDetector

print(len(KeypointDetector.available_backbones())) # Output: 0
print(len(KeypointDetector.available_heads())) # Output: 0

Expected behavior

I'm not sure what are all the available backbones and heads for KeypointDetector. However, from the source code of KeypointDector (see the excerpt below) there should be at least 1 available backbones and heads, respectively.

backbone: Optional[str] = "resnet18_fpn",
head: Optional[str] = "keypoint_rcnn",

Environment

  • PyTorch Version (e.g., 1.0): 1.7.1+cu110
  • OS (e.g., Linux): Ubuntu 20.04
  • How you installed PyTorch (conda, pip, source): pip install torch==1.7.1+cu110 torchvision==0.8.2+cu110 -f https://download.pytorch.org/whl/torch_stable.html
  • Build command you used (if compiling from source): NA
  • Python version: 3.8.10
  • CUDA/cuDNN version:
  • GPU models and configuration: RTX3090
  • Any other relevant information: Flash version 0.6.0

Additional context

@martin0258 martin0258 added bug / fix Something isn't working help wanted Extra attention is needed labels Jan 19, 2022
@ethanwharris
Copy link
Collaborator

Hey @martin0258 in order for the backbones to be available you would need to install icevision and lightning-flash[image]. So you could do the following:

pip install --upgrade icevision lightning-flash[image]

Hope that helps 😃

@martin0258
Copy link
Author

Thank you @ethanwharris! It's working after I ran pip install icevision==0.8.0. Below is the result

In [1]: from flash.image import KeypointDetector

In [2]: KeypointDetector.available_backbones()
Out[2]: 
['mobilenet',
 'resnet101',
 'resnet101_fpn',
 'resnet152',
 'resnet152_fpn',
 'resnet18',
 'resnet18_fpn',
 'resnet34',
 'resnet34_fpn',
 'resnet50',
 'resnet50_fpn',
 'resnext101_32x8d',
 'resnext101_32x8d_fpn',
 'resnext50_32x4d_fpn',
 'wide_resnet101_2_fpn',
 'wide_resnet50_2_fpn']

In [3]: KeypointDetector.available_heads()
Out[3]: ['keypoint_rcnn']

Just FYI: I installed icevision 0.8.0 because the latest icevision isn't compatible with my existing PyTorch 1.7.1+cu110. Also, previously I have already installed lightning-flash[image] with pip install 'lightning-flash[image]'. Your command pip install lightning-flash[image] would cause error zsh: no matches found: lightning-flash[image].

My last question: Is it documented somewhere? I mean the knowledge of in order for the backbones and heads to be available we would need to install icevision and lightning-flash[image].

@ethanwharris
Copy link
Collaborator

ethanwharris commented Jan 25, 2022

Hi @martin0258 glad you got it working!

My last question: Is it documented somewhere? I mean the knowledge of in order for the backbones and heads to be available we would need to install icevision and lightning-flash[image].

Great question! It should have been, for other methods you would receive an error message letting you know what to install, but it looks like we missed it for these (we should eventually also add support for optional dependencies that would add some backbones but are not requied for the task to run). I'll leave this issue open as a bug report to add the message. Hope that helps 😃

@ethanwharris ethanwharris changed the title KeypointDetector has no available_backbones and available_heads Add required dependencies error message to available_* methods. Jan 25, 2022
@ethanwharris ethanwharris added this to the v0.7 milestone Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug / fix Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants