Open lizziesilver opened 1 year ago
check this file flash/core/utilities/imports.py
:
_IMAGE_AVAILABLE = all(
[
_TORCHVISION_AVAILABLE,
_TIMM_AVAILABLE,
_PIL_AVAILABLE,
_ALBUMENTATIONS_AVAILABLE,
_PYSTICHE_AVAILABLE,
_SEGMENTATION_MODELS_AVAILABLE,
]
)
If any of the above is False, then it throws this error. In my case _PYSTICHE_AVAILABLE
was False
although it was installed, it couldn't be imported because the version was wrong. Installing a correct version from requirements fixed the issue
Thank you @Rusteam ! It turned out that albumentations
was not available because cv2
was not installed. Running pip install opencv-python
before installing flash solved that problem.
Unfortunately I still can't import flash because of another issue, but it should be a one-line change. I will fork the repo and see if I can resolve it :)
Also have this problem
It turns out that pystiche requires torch 1.12 and torchvision 0.13. Perhaps consider using poetry to manage the dependencies? It also has a pre-commit hook to export a requirements.txt file on every commit.
It turns out that pystiche requires torch 1.12 and torchvision 0.13. Perhaps consider using poetry to manage the dependencies? It also has a pre-commit hook to export a requirements.txt file on every commit.
I am not sure if I understand what you mean... can you elaborate? in general, have aligned PyTorch and TorchVision versions is quite challenging
thanks for your reply! I guess what would be helpful is when the dependencies are pinned to specific versions.
poetry is a tool which can help with that. https://python-poetry.org/
I guess what would be helpful is when the dependencies are pinned to specific versions.
That would work for end applications or server app, but for frameworks like this one it would restrict what other packages can be used with...
ok, I can reproduce this same issue also with master as well as 0.8.2
🐛 Bug
After running
pip install 'lightning-flash[image]'
, when I try to create anImageEmbedder
, I get:ModuleNotFoundError: Required dependencies not available. Please run: pip install 'lightning-flash[image]'
Background:
lightning-flash[image]
into a docker container built on the jupyter base-notebook container, to minimise what else is installed.lightning-flash
is tagged as supporting python 3.7, 3.8, 3.9.To Reproduce
1. Create this Dockerfile:
2. Build the container and save the build logs
docker build --no-cache --progress=plain -t flash:latest . &> build.log
Build log file is attached, looks fine to me. build.log
3. Run the container and create a notebook
I run as root, and mount the notebooks folder to save my work:
docker run -it -v $(PWD)/notebooks:/home/jovyan/work --user root -e GRANT_SUDO=yes -p 8888:8888 flash:latest
Navigate to http://127.0.0.1:8888/lab/tree/work/ in the browser and enter the token. Create a notebook.
4. Run the following code from the embeddings tutorial:
This produces the following error:
Expected behavior
After installing
lightning-flash[image]
I should not get an error message telling me to installlightning-flash[image]
. I should be able to instantiate anImageEmbedder
.Environment