facebookresearch/d2go

ModuleNotFoundError: No module named 'pytorch_lightning.utilities.logger'

GabrielEnriquezXR opened this issue ยท 2 comments

Instructions To Reproduce the ๐Ÿ› Bug:

  1. Full runnable code or full changes you made:

I created a fresh Anaconda environment:

conda create --name Segmentation
conda activate Segmentation
  1. What exact command you run:

I then followed the installation commands as instructed here.

conda install pytorch torchvision cudatoolkit=10.2 -c pytorch-nightly
python -m pip install "git+https://github.com/facebookresearch/detectron2.git"
python -m pip install "git+https://github.com/facebookresearch/mobile-vision.git"
git clone https://github.com/facebookresearch/d2go
cd d2go & python -m pip install .

Next, I execute the commands to run the demo as instructed here.

cd demo/
python demo.py --config-file faster_rcnn_fbnetv3a_C4.yaml --input input1.jpg --output output1.jpg

Afterwards, I get this error message:

ModuleNotFoundError: No module named 'pytorch_lightning.utilities.logger'
  1. Full logs or other relevant observations:
Traceback (most recent call last):
  File "C:\Users\Admin\d2go\demo\demo.py", line 11, in <module>
    from d2go.model_zoo import model_zoo
  File "C:\Users\Admin\anaconda3\envs\Segmentation\lib\site-packages\d2go\model_zoo\model_zoo.py", line 7, in <module>
    from d2go.runner import create_runner
  File "C:\Users\Admin\anaconda3\envs\Segmentation\lib\site-packages\d2go\runner\__init__.py", line 14, in <module>
    from .lightning_task import DefaultTask
  File "C:\Users\Admin\anaconda3\envs\Segmentation\lib\site-packages\d2go\runner\lightning_task.py", line 43, in <module>
    from pytorch_lightning.utilities.logger import _flatten_dict
ModuleNotFoundError: No module named 'pytorch_lightning.utilities.logger'
  1. please simplify the steps as much as possible so they do not require additional resources to run, such as a private dataset.

OS: Windows 10 Pro version 10.0.19043 build 19043

Running conda list gives me the following version numbers:

cudatoolkit               10.2.89
d2go                      0.0.1b20220225
detectron2                0.6
mobile-cv                 0.1
python                    3.9.7
pytorch                   1.12.0.dev20220222
pytorch-lightning         1.5.10

Expected behavior:

I should be able to run the inference demo on an input image; however, I get an error message as mentioned above.

I also faced same issue, but I was able to solve it by following installation.
!pip install git+https://github.com/PyTorchLightning/pytorch-lightning

@AnshulVijay Thanks! It worked.