在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:jxcodetw/docker-jupyter-pytorch开源软件地址:https://github.com/jxcodetw/docker-jupyter-pytorch开源编程语言:Dockerfile 87.5%开源软件介绍:FeaturesThis image contains pytorch, jupyter notebook, tensorboardx, and other useful python packages (See Dockerfile). Default workdir is /workspace which is the root folder for jupyter notebook. You can run this image with your own user/group. So that the files created won't change the owner/group to root. RequirementsYou'll need nvidia-docker v2 to run with gpu support. Example Usage$ NV_GPU=0,1 nvidia-docker run -it \
--name testorch \
-u $(id -u ${USER}):$(id -g ${USER}) \
-v $PWD:/workspace \
jxcodetw/jupyter-pytorch
# arguments
# NV_GPU controls gpu isolation
# --name [your custom name]
# -u save file with permission as current user
# $PWD mount current directory to jupyter's startup folder (/workspace) FAQsIn this FAQ, there are the solutions I used but not necessarily the best approaches :p. Which Nvidia driver version to use?This image inherited from pytorch/pytorch:latest. You should check the cuda version they used.
https://hub.docker.com/r/pytorch/pytorch By the time this image is created they use nvidia/cuda:10.0-cudnn7-devel-ubuntu16.04 https://hub.docker.com/r/nvidia/cuda/ And some CUDA version might need specific version of driver to work. NVIDIA-SMI 410.78 Driver Version: 410.78 CUDA Version: 10.0 How to get token for jupyter notebook?you just run with -it flags and you will attach to the container and see the output from jupyter notebook. If you start the container with -dit flags then you should print the logs to get the token. $ docker logs [container name or id] How do I know the container's IP address?To access the notebook you'll need to know the ip of the container and connect to the 8888 port. $ docker inspect -f \
'{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' \
[container name or id] Then you can access the jupyter notebook via http://172.x.x.x/?token=asdfasdfasdf...asdf If you run the container on your remote server and you want to access to it on your local machine. ssh -L [local_port]:172.x.x.x:8888 [user]@[server-ip]
# if you want to learn more what it is. There's a tons of tutorial on the int.ernet Then open your browser to http://localhost:[local_port]/?token=asdfadsfasdf...asdf How do I set the visible GPUs in container?Reference: https://github.com/NVIDIA/nvidia-docker/wiki/nvidia-docker#gpu-isolation $ NV_GPU=0,1 nvidia-docker ...
# For example, if you have two gpus on your computer
$ NV_GPU=0 nvidia-docker ... # first container
$ NV_GPU=1 nvidia-docker ... # second container |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论