ObjectDetectionData is missing dependencies even though pip worked
NikolasE opened this issue ยท 2 comments
๐ Bug
I want to create an ObjectDetectionData-object but get the error message:
"ModuleNotFoundError: Required dependencies not available. Please run: pip install 'icevision' 'lightning-flash[image]'"
Even though I successfully executed the pip install.
To Reproduce / Code sample
pip install 'icevision' 'lightning-flash[image]'
# collect some data
from flash import Trainer
from flash.image import ObjectDetector, ObjectDetectionData
datamodule = ObjectDetectionData.from_files(
train_files=train_files,
train_targets=train_targets,
train_bboxes=train_bboxes,
predict_files=list(),
transform_kwargs=dict(image_size=(128, 128)),
batch_size=2,
)
Expected behavior
ObjectDetectionData-instance is created
Environment
- OS (e.g., Linux): Ubuntu
- Python version: 3
- PyTorch/Lightning/Flash Version (e.g., 1.10/1.5/0.7): 1.10.2/1.8.3.post1/0.8.1
- GPU models and configuration:
- Any other relevant information:
Additional context
the icevision
is listed in another extra file: https://github.com/Lightning-AI/lightning-flash/blob/master/requirements/datatype_image_extras.txt
let's address it in #1488
Hi @NikolasE thanks for reporting this. After a bit of digging it looks like this is caused by one of the dependencies of icevision being upgraded causing compatibility issues. The icevision repo has a fix but it hasnโt been released yet, until then the solution is to run:
pip install 'sahi<0.11'
Hope that helps ๐
I'll leave this issue open until the fix in icevision is released
@Borda Icevision isn't in any extras, instead it's intended to be installed separately