简体   繁体   中英

Dockerfile for tensorflow GPU + opencv3 + Jupyter Notebook?

I am a bit confused. Now I am not using a dockerfile but the command:

docker run -it --rm -v $(realpath ~/path/of/directory):/tf/notebooks -p 8888:8888 tensorflow/tensorflow:latest-py3-jupyter

But I don't have access to cv2 module. Maybe add something to the run command or write my own dockerfile? but I don't know how. Do I have to pip install and RUN tensorflow GPU and jupyter notebook in the dockerfile?

Check if this image tensorflow/tensorflow:latest-py3-jupyter has installed opencv and python module cv2. If it doesn't you should find another image or install it by yourself.

Tensorflow image by default does not have OpenCV in it.

There are two ways you can set it up:

A - Setup tensorflow docker container and then install using commands

OR

B - Create a docker file which takes tensorflow image as base image and install opencv using commands while building the image.

Please refer to the below link to do the same.

https://github.com/fbcotter/docker-tensorflow-opencv

https://github.com/fbcotter/docker-tensorflow-opencv/blob/master/Dockerfile

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM