I'm using a separate environment called (tensorflow-sessions) and have opencv installed there through:
(tensorflow-sessions) $conda install -c menpo opencv
And in my normal path through:
pip install opencv-python
It works fine when I'm not in my environment, but not when I'm in it. Here's the error I get:
<ipython-input-13-78e172347b91> in <module>
----> 1 from imageai.Detection import VideoObjectDetection
2 import os
3 execution_path = os.getcwd()
4 detector = VideoObjectDetection()
5 # SqueezeNet, ResNet, InceptionV3 and DenseNet.
~\Anaconda3\envs\tensorflow-sessions\imageai\Detection\__init__.py in <module>
----> 1 import cv2
2
3 from imageai.Detection.keras_retinanet.models.resnet import resnet50_retinanet
4 from imageai.Detection.keras_retinanet.utils.image import read_image_bgr, read_image_array, read_image_stream, preprocess_image, resize_image
5 from imageai.Detection.keras_retinanet.utils.visualization import draw_box, draw_caption
~\Anaconda3\envs\tensorflow-sessions\cv2\__init__.py in <module>
1 import importlib
2
----> 3 from .cv2 import *
4 from .data import *
5
ModuleNotFoundError: No module named 'cv2.cv2'
What is causing this? Thanks in advance.