question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ModuleNotFoundError - Please, pip install . '[image]'

See original GitHub issue

🐛 Bug

The finetuning object dection example https://lightning-flash.readthedocs.io/en/latest/reference/object_detection.html#finetuning fails with error

Exception has occurred: ModuleNotFoundError
Please, pip install . '[image]'

To Reproduce

Steps to reproduce the behavior:

Run the lightning flash object detection fine tuning example.

https://lightning-flash.readthedocs.io/en/latest/reference/object_detection.html#finetuning

Code sample

import flash
from flash.core.data.utils import download_data
from flash.image import ObjectDetectionData, ObjectDetector

# 1. Download the data
# Dataset Credit: https://www.kaggle.com/ultralytics/coco128
download_data("https://github.com/zhiqwang/yolov5-rt-stack/releases/download/v0.3.0/coco128.zip", "data/")

# 2. Load the Data
datamodule = ObjectDetectionData.from_coco(
    train_folder="data/coco128/images/train2017/",
    train_ann_file="data/coco128/annotations/instances_train2017.json",
    val_split=0.3,
    batch_size=4,
    num_workers=4,
)

# 3. Build the model
model = ObjectDetector(model="retinanet", num_classes=datamodule.num_classes)

# 4. Create the trainer
trainer = flash.Trainer(max_epochs=3, limit_train_batches=1, limit_val_batches=1)

# 5. Finetune the model
trainer.finetune(model, datamodule=datamodule)

# 6. Save it!
trainer.save_checkpoint("object_detection_model.pt")`

Expected behavior

The fine-tuning example of object detection is expected to run.

Environment

  • PyTorch Version: 1.7.1
  • OS (e.g., Linux): Ubuntu 20.04
  • How you installed PyTorch: Pip
  • Python version: Python 3.6.13 :: Anaconda, Inc.
  • cuDNN version: 7.6
  • GPU models and configuration:

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
akihironittacommented, May 26, 2021

@deepseek-eoghan Thank you for your interest!

am I able to make a branch to make the changes for the PR?

No, you cannot create a branch in this repository. First, you need to fork (=copy) this repository for you to make changes. Here’s an overview for contribution:

  1. Fork (=copy) this repository so that you can make changes.
  2. Make changes in your repository. (i.e. https://github.com/deepseek-eoghan/lightning-flash) (you can make a branch in your repository)
  3. Submit a PR. :]

You can find more details at https://github.com/PyTorchLightning/lightning-flash/blob/master/.github/CONTRIBUTING.md.

1reaction
deepseek-eoghancommented, May 26, 2021

Great thanks @akihironitta, am I able to make a branch to make the changes for the PR?

Read more comments on GitHub >

github_iconTop Results From Across the Web

ModuleNotFoundError: No module named 'Image' in Python
To solve the error, install the module by running the pip install Pillow command.
Read more >
No module named Image - python - Stack Overflow
6 Answers 6 · 1) make sure it is available python -m pip install Image · 2) where is it available? sudo find...
Read more >
ModuleNotFounderror: No Module Named 'Image' in Python
Quick Fix: Python raises the ModuleNotFoundError: No module named 'Image' when the PIL/pillow library providing the module Image is not installed but used ......
Read more >
ModuleNotFoundError - Please, pip install . '[image]' · Issue #341
The fine-tuning example of object detection is expected to run. Environment. PyTorch Version: 1.7.1; OS (e.g., Linux): Ubuntu 20.04; How you installed PyTorch: ......
Read more >
ModuleNotFoundError: No module named 'PIL' - Python Help
usr/bin/python3 # On 10/4/22 I installed version Python 3.10.7 # Does ... from PIL import Image # ModuleNotFoundError: No module named 'PIL'
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found