Saurabh Chauhan
Saurabh Chauhan

Reputation: 3211

Can't access directory using path

I have set up tensorflow GPU docker from https://tensorflow.org/install/docker. I am trying to load directory using import os library in Jupyter notebook on top of tensorflow GPU in Ubuntu. I can access import os library and fetch directory details using standalone python in terminal but can't able to fetch directory details in Jupyter notebook on top of tensorflow gpu.

Standalone Python:

Python 3.6.7 (default, Oct 22 2018, 11:32:17) 
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> base_dir="/home/chief/Desktop/ML/data"
>>> print(len(os.listdir(base_dir)))
3

Jupyter notebook using tensorflow gpu: enter image description here

I am running the tensorflow gpu using the following command:

sudo docker run --runtime=nvidia -it -p 8888:8888 tensorflow/tensorflow:latest-gpu-py3

Am I missing something? Any help is appreciated.

Upvotes: 0

Views: 781

Answers (3)

Saurabh Chauhan
Saurabh Chauhan

Reputation: 3211

I can able to solve this using following command:

docker run --runtime=nvidia -it -p 8888:8888 -v /home/chief/Desktop/ML/:/notebooks tensorflow/tensorflow:latest-gpu-py3

Upvotes: 0

Chandu
Chandu

Reputation: 2129

sudo docker run --runtime=nvidia -it -p 8888:8888 tensorflow/tensorflow:latest-gpu-py3 -v /home/chief/Desktop/ML/data:/notebooks/ML_data

Hope it helps.

Upvotes: 0

Biswajit Panday
Biswajit Panday

Reputation: 837

You are missing the tailing '/'

base_dir="/home/chief/Desktop/ML/data/"

Upvotes: 1

Related Questions