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

Installing [image] extras is not sufficient on Python 3.6? #451

Closed
brimoor opened this issue Jun 22, 2021 · 1 comment · Fixed by #583
Closed

Installing [image] extras is not sufficient on Python 3.6? #451

brimoor opened this issue Jun 22, 2021 · 1 comment · Fixed by #583
Assignees
Labels
bug / fix Something isn't working help wanted Extra attention is needed

Comments

@brimoor
Copy link
Contributor

brimoor commented Jun 22, 2021

🐛 Bug

On Python 3.6, pip install lightning-flash[image] is not sufficient to allow me to use an ObjectDetector:

from flash.image import ObjectDetector

# error: tells me I need to `pip install 'lightning-flash[image]'`, but I already did!
model = ObjectDetector.load_from_checkpoint("https://flash-weights.s3.amazonaws.com/object_detection_model.pt")

I believe the issue is that pycocotools has a python_version >= 3.7 marker in the requirements file. Either that environment marker is necessary, in which case the image extras only support Python 3.7+, or the marker should be removed.

FWIW, I manually pip install pycocotools and was able to successfully use the checkpoint that I tried to load in the example code below.

To Reproduce

Create a fresh environment:

conda create -n test python=3.6
conda activate test

pip install lightning-flash
pip install 'lightning-flash[image]'

Now try to use the image extras:

from flash.image import ObjectDetector

# error: tells me I need to `pip install 'lightning-flash[image]'`, but I already did!
model = ObjectDetector.load_from_checkpoint("https://flash-weights.s3.amazonaws.com/object_detection_model.pt")

Environment

  • OS (e.g., Linux): macOS 10.14.6
  • Python version: Python 3.6.13 :: Anaconda, Inc.
  • Lightning Flash version: 0.4.0
@brimoor brimoor added bug / fix Something isn't working help wanted Extra attention is needed labels Jun 22, 2021
@ethanwharris
Copy link
Collaborator

Hi @brimoor, thanks for bringing this to our attention. I can see that there was some discussion about it in the original PR here: https://github.com/PyTorchLightning/lightning-flash/pull/56/files#r571734084
@kaushikb11 Is there something we can put in the requirements so we can remove the Python 3.7 check?
Otherwise at the very least we can remove the check for coco from the check for image extras, but ideally this would just work as expected.

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
3 participants